Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

Birdseye

Schüler

  • »Birdseye« ist der Autor dieses Themas

Beiträge: 125

Wohnort: De Haan

Beruf: Freelance Photographer

  • Nachricht senden

1

Donnerstag, 1. Juli 2010, 07:49

Multiple conditions

Hi,
I'm relativaly new with KRPanoplayer (Ex FPP) and I have the following question.
Is it possible to use multiple conditions in the scripting?
I have a mutiframe panotour with pano's that took place at different dates. I have made images of the calendar dates in the pano.
I'd like to, when the user changes the pano, the image of the date will change too. I tried it this way...

<action name="checkdate">
if(image.frame == 1,set(plugin[calendar].url,images/calendar_1.png),
image.frame == 2,set(plugin[calendar].url,images/calendar_2.png),
image.frame == 3,set(plugin[calendar].url,images/calendar_3.png)
);
</action>

But it doesn't work. Can somebody help me further?
Thanks in advance,
Yvan.

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Donnerstag, 1. Juli 2010, 10:12

you could use if/else and nest them

Quellcode

1
if(condition, trueaction, falseaction);

So your code would be

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<action name="checkdate">
if(image.frame == 1, 
	set(plugin[calendar].url,images/calendar_1.png),
	if(image.frame == 2,
		set(plugin[calendar].url,images/calendar_2.png),
		if(image.frame == 3,
			set(plugin[calendar].url,images/calendar_3.png),
			trace("image frame isn't 1,2 or 3");
		);
	);
);
</action>

3

Donnerstag, 1. Juli 2010, 10:12

try:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
<action name="checkdate">
if(image.frame == 1,
	set(plugin[calendar].url,images/calendar_1.png);
<!--else-->,
	if(image.frame == 2,
		set(plugin[calendar].url,images/calendar_2.png);
	<!--else-->,
		if(image.frame == 3,
			set(plugin[calendar].url,images/calendar_3.png);
		);
	);
);
</action>

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Donnerstag, 1. Juli 2010, 10:13

Hehe posted at the same time

Birdseye

Schüler

  • »Birdseye« ist der Autor dieses Themas

Beiträge: 125

Wohnort: De Haan

Beruf: Freelance Photographer

  • Nachricht senden

5

Donnerstag, 1. Juli 2010, 10:32

tnxs 2 both ;) I'll try this out.

Birdseye

Schüler

  • »Birdseye« ist der Autor dieses Themas

Beiträge: 125

Wohnort: De Haan

Beruf: Freelance Photographer

  • Nachricht senden

6

Donnerstag, 1. Juli 2010, 11:03

And it works ! Thank you very much *smile*

bulp

Fortgeschrittener

Beiträge: 390

Wohnort: Malaysia

  • Nachricht senden

7

Samstag, 3. Juli 2010, 06:26

Zephyr and pinsane..

thank you for the code... id try it and it works... my question would be how to shortened this code

<action name="hotspot3d">
if(image.frame == 3, set(hotspot[hs1].visible,true) );
if(image.frame LT 3, set(hotspot[hs1].visible,false) );
if(image.frame GT 3, set(hotspot[hs1].visible,false) );
</action>

mean i want the only frame 3 that have hotspot etc and if move to next or previous frame the hotspot will disappear..

regrads

bulp

8

Samstag, 3. Juli 2010, 08:50

i want the only frame 3 that have hotspot etc and if move to next or previous frame the hotspot will disappear..


This will make the hotspot only appear for frame 3:

Quellcode

1
2
3
<action name="hotspot3d">
	if(image.frame == 3, set(hotspot[hs1].visible,true);,set(hotspot[hs1].visible,false););
</action>
The action hotspot3d should be called immediately after the frame is incremented or decremented. For instance, if your are using the multiframeskin.xml found in the krpanotools template/skin directory, hotspot3d would immediately follow the inc and dec calls found in the nextframe and prevframe actions respectively.

(Let's see if Zephir and I post simultaneously again! ;-) )

steve

bulp

Fortgeschrittener

Beiträge: 390

Wohnort: Malaysia

  • Nachricht senden

9

Montag, 5. Juli 2010, 13:50

lol Pinsane... Zephir is busy i think....

anyway thank you for the code... it work!! .. :)



regards

bulp