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.

Timescale

Trainee

  • "Timescale" started this thread

Posts: 120

Location: Netherlands

Occupation: Archaeologist, Timescale R&D

  • Send private message

1

Friday, December 9th 2016, 1:21pm

Flyout hotspot offset

Hi Everyone,

A client wanted text on panels in-pano which, as you all can imagine is a terrible idea on smartphone screens! So I extended the flyout functionality with a Q&D zoom function, but certain panels zoom out of view. So now I need a way to move the zoomed in flown out image around.

It it possible to offset a flyout hotspot in the X and Y direction? Standard flown out hotspots are centered on screen. I need to be able to move them.

Thanks in advance.

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Friday, December 9th 2016, 2:07pm

Hi)

Try ox/oy offsets
Regards,

Alexey

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

3

Friday, December 9th 2016, 2:14pm

Try soemthing like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<hotspot name="spot1" style="flyoutimage" keep="true"
	         url="image_1.jpg"
	         zorder="1"
	         ath="45"
	         atv="54"
	         ox="0" oy="0"
	         x_offset="200"
	         y_offset="100"
	         scale="0.4"
	         rx="-22.5" ry="-26.25" rz="-50.1"
	         />

	<!-- flyout hotspot actions -->
	<action name="flyout_hotspot">
	  trace(ath);showlog();
		for(set(i,0), i LT hotspot.count, inc(i),
			copy(hs, hotspot[get(i)]);
			if(hs.name != name AND hs.style == 'flyoutimage' AND (hs.flying_state == 'out' OR hs.flying_state == 'flyingout'),
				callwith(hs, flyout_hotspot() );
			  );
		  );

		if(flying_state == 'flyingout',
			set(flying_state, 'flyingin');
		  ,
			if(flying_state == 'flyingin',
				set(flying_state, 'flyingout');
		  	  );
		  );

		if(flying_state == 'in',
			calc(backup_state, '0.0|' + rx + '|' + ry + '|' + rz + '|' + scale+ '|' + ox + '|' + oy);			
			copy(backup_zorder, zorder);
			set(flying_state, 'flyingout');
		  );

		if(flying_state == 'out',
			set(flying_state, 'flyingin');
		  );

		if(flying_state == 'flyingout',
			set(zorder, 99);						
			tween(flying|rx|ry|rz|scale|ox|oy, calc('1.0|0.0|0.0|0.0|1.0|'+x_offset+'|'+y_offset), 0.5, default, set(flying_state,'out'); set(capture,true); );
		  );

		if(flying_state == 'flyingin',
			sub(zorder,1);
			set(capture,false);
			tween(flying|rx|ry|rz|scale|ox|oy, get(backup_state), 0.5, default, set(flying_state,'in'); copy(zorder,backup_zorder); );
		  );
	</action>

Timescale

Trainee

  • "Timescale" started this thread

Posts: 120

Location: Netherlands

Occupation: Archaeologist, Timescale R&D

  • Send private message

4

Friday, December 9th 2016, 2:33pm

Thank

Ah yes, I think I can work something out from this!

Thanks


Edit : Managed to make a pointer driven function that lets me move the flyout hotspot in certain cases.. Thanks again for the tip!

This post has been edited 1 times, last edit by "Timescale" (Dec 9th 2016, 3:08pm)