Sie sind nicht angemeldet.

1

Montag, 14. März 2011, 10:43

Autorotate stoppen beim Klick auf Flyout-Hotspot

...das funktioniert bereits.
Ich möchte also autorotate.enable durch "switch" auf "false" setzen sobald ein Flyout-Hotspot geklickt wird. Wenn ich nun auf den geöffneten Flyout-Hotspot klicke fährt er wieder zurück und autorotate geht wieder an.

Soweit O.K....

Wenn ich, während der 1. Flyout-Hotspot noch offen ist, einen der anderen Flyout-Hotspots klicke fährt der 1. wieder zurück und der 2. fährt ins Bild. Da die Funktion "switch" ja togglelt wird nun das autorotate wieder eingeschaltet. Das autorotate muss also so lang ausbleben bis alle Hotspots quasi in Ruheposition sind.

Ich habe auch anstatt "switch" "set" versucht - geht nicht.

Also: Ich brauche eine Funktion die nachschaut ob alle Flyout-Hotspot in Ruheposition sind und die das autorptate stoppt und erst wieder freigibt wenn alle Flyout-Hotspots iwieder in Ruheposition sind...



Vielen Dank an alle fleissigen Helferlein...


GLG Andy *confused*

Hier der Code:

Quellcode

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	<style name="flyoutimage"
	   	distorted="true"
	   	backup_rx="0"
	   	backup_ry="0"
	   	backup_rz="0"
	   	backup_scale="0"
	   	backup_zorder="0"
	   	flying="0.0"
	   	flystate="0"
	   	onclick="if(flystate == 0, flyout_by_name(get(name)), flyback_by_name(get(name)) ); switch(autorotate.enabled).false;"
	   	/>

	<hotspot name="spot1" style="flyoutimage"
	     	url="image1.jpg"
	     	zorder="1"
	     	ath="45"
	     	atv="54"
	     	scale="0.5"
	     	rx="-22.5" ry="-26.25" rz="-50.1"
	     	/>

	<hotspot name="spot2" style="flyoutimage"
	     	url="image2.jpg"
	     	zorder="2"
	     	ath="60"
	     	atv="54"
	     	scale="0.5"
	     	rx="-22.5" ry="-26.25" rz="-50.1"
	     	/>

	<hotspot name="spot3" style="flyoutimage"
	     	url="image3.jpg"
	     	zorder="3"
	     	ath="73"
	     	atv="55"
	     	scale="0.5"
	     	rx="-22.5" ry="-26.25" rz="-50.1"
			 />
			 
<action name="flyout_by_name">
		<!-- make all other hotspots flying back -->
		flyback_others();

		<!--
			for best control set 4 fly states:
			0 = normal
			1 = while flying out
			2 = out
			3 = while flying back
		-->

		<!-- save original position/rotation -->
		if(hotspot[%1].flystate == 0,
			copy(hotspot[%1].backup_rx, 	hotspot[%1].rx);
			copy(hotspot[%1].backup_ry, 	hotspot[%1].ry);
			copy(hotspot[%1].backup_rz, 	hotspot[%1].rz);
			copy(hotspot[%1].backup_scale,  hotspot[%1].scale);
			copy(hotspot[%1].backup_zorder, hotspot[%1].zorder);
		  );

		<!-- set new state -->
		set(hotspot[%1].flystate,1);
		set(hotspot[%1].zorder,99);

		<!-- tween the rotations values to 0 for a flat screen view -->
		tween(hotspot[%1].rx, 0);
		tween(hotspot[%1].ry, 0);
		tween(hotspot[%1].rz, 0);
		tween(hotspot[%1].scale, 1.5);

		<!--
			tween 'flying' to 1.0,
			this makes the hotspot independent from the panorama rotation and scaling
		-->
		tween(hotspot[%1].flying, 1.0, 0.5, default, set(hotspot[%1].flystate,2); );
	</action>


	<action name="flyback_by_name">
		if(hotspot[%1].flystate != 3,
			set(hotspot[%1].flystate,3);

			<!-- tween back to the stored backup values -->
			tween(hotspot[%1].rx,	get(hotspot[%1].backup_rx)	);
			tween(hotspot[%1].ry,	get(hotspot[%1].backup_ry)	);
			tween(hotspot[%1].rz,	get(hotspot[%1].backup_rz)	);
			tween(hotspot[%1].scale, get(hotspot[%1].backup_scale) );

			copy(hotspot[%1].zorder, hotspot[%1].backup_zorder);

			<!-- tween 'flying' also back to 0.0 -->
			tween(hotspot[%1].flying, 0.0, 0.5, default, set(hotspot[%1].flystate,0); );
		  );
	</action>


	<action name="flyback_others">
		if(%1 != nextloop, set(i,0));
		
		if(hotspot[%i].style == flyoutimage,
			if(hotspot[%i].flystate != 0, flyback_by_name(get(hotspot[%i].name)); );
		  );
		  
		inc(i);
		if(i LT hotspot.count, flyback_others(nextloop); );
	</action>
Andreas Schaefer

panoconcept.de

2

Montag, 14. März 2011, 11:16

Hi,

hier ein Beispielcode dazu:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<action name="flyback_others">
  if(%1 != nextloop, set(i,0));
		
  if(hotspot[%i].style == flyoutimage,
    if(hotspot[%i].flystate != 0, flyback_by_name(get(hotspot[%i].name)); );
    );
		  
  inc(i);
  if(i LT hotspot.count, flyback_others(nextloop), delayecall(0.1,check_hotspots_state()) );
</action>

<action name="check_hotspots_state">
  if(%1 != nextloop, set(i,0); set(flyouthotspots,0); );

  if(hotspot[get(i)].flystate != 0, inc(flyouthotspots));

  inc(i);
  if(i LT hotspot.count, check_hotspots_state(nextloop), if(flyouthotspots==0, set(autorotate.enabled,true), set(autorotate.enabled,false)); );
</action>


Schöne Grüße,
Klaus

3

Montag, 14. März 2011, 23:17

Hat fast geklappt...

Hi Klaus,

wieder einmal ein großes DANKESCHÖN!

In Zeile 19 ist ein kleiner Schreibfehler "delayedcall..."

Ich habe mit Deinem Code ab der Zeile 97(meines Beispiels) alles überschrieben.

Trotzdem gehts leider nur halb. Das autorotate fängt nicht wieder an nach dem die Flyout-Hotspots alle geschlossen sind. Mir fällt es schwer den Code zu interpretieren(geschweige denn dass ich das selbst hinbekommen hätte) aber die autorotation sollte doch wieder beginnen(
set(autorotate.enabled,true), set(autorotate.enabled,false))
oder?


GLG Andy
Andreas Schaefer

panoconcept.de

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »darcman« (14. März 2011, 23:38)


4

Freitag, 18. März 2011, 16:39

?!?

Wenn jemand eine idee hat!? Es klappt nur in eine Richtung. autorotate hält an aber startet nicht mehr.

Also - her mit euren Ideen... *rolleyes*


LG Andy
Andreas Schaefer

panoconcept.de

5

Dienstag, 5. April 2011, 12:34

Hi,

du müsstest die kompletten "flyback_others" Action ersetzen und die "check_hotspots_state" Action hinzufügen
(und natürlich den delayecall Fehler ausbesseren ), dann müsste es eigentlich funktionieren...

Schöne Grüße,
Klaus