You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,340

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

1

Monday, March 2nd 2020, 10:00am

Drag layer function in plugin interface

Hi,

i am playing/learning to use the plugin interface a bit more/better. (with all the setter and getter stuff etc.
Until now i mostly used it for some plain js and transfer scripts.

I particularly have one issue now and that is to make the 'drag layer' action work and/or rewrite in js.

original xml action:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
	<action name="dragpoly">
		copy(drag_currentx, x);
		copy(drag_currenty, y);
		copy(drag_stagex, mouse.stagex);
		copy(drag_stagey, mouse.stagey);
		indexoftxt(align_contains_right, get(align), 'right');
		indexoftxt(align_contains_bottom, get(align), 'bottom');
		calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
		calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
		asyncloop(pressed,
			calc(x, drag_currentx + (mouse.stagex - drag_stagex)*drag_align_x);
			calc(y, drag_currenty + (mouse.stagey - drag_stagey)*drag_align_y);
           
            screentosphere(x, y, athh, atvv);
            
            trace(get(athh));
            updatescreen ();
		  );
	</action>


i tried a lot but i can't get it to work.
What am i missing?

I think my biggest problem is in the asyncloop part.. not sure though..
I'll try to prepare an example.

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

This post has been edited 2 times, last edit by "Tuur" (Mar 2nd 2020, 12:32pm)