Sie sind nicht angemeldet.

1

Dienstag, 4. Januar 2011, 23:25

Get title of current scene

Is there a way of retrieving the name / title of the current scene in 1.0.8.12 ?

I understand how to get one if you know the name of the scene you want, but not how to retrive the *current* scene.

Thanks,

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Mittwoch, 5. Januar 2011, 08:37

try get(xml.scene);

*cool*

HansNyb

Profi

Beiträge: 1 063

Wohnort: Denmark

Beruf: Photographer

  • Nachricht senden

3

Mittwoch, 5. Januar 2011, 11:21

I have not tested it yet but Klaus had a suggestion here.
http://www.krpano.com/forum/wbb/index.ph…d&threadID=4126

Hans

4

Mittwoch, 5. Januar 2011, 11:39

Should use a state machine

You should use the concept of a state machine to determine which scene is loaded. When you trigger the event which loads the next scene such as 'onclick' you should call a function that changes the state and calls another function that makes changes dependent upon the new scene. So the onclick event has a function call with the new state passed as a parameter.

<hotsplot name="first"
...
onclick="switchScene(first);"
...
/>

<action name="switchScene">
if(hotspot[
...

5

Mittwoch, 5. Januar 2011, 22:48

try get(xml.scene);

*cool*
Thanks - this worked a treat - I actually used

Quellcode

1
get(scene[get(xml.scene)].title



to get the title of the current scene. I was using it to set a value of a text field, based on the scene's title.

I didn't want to have to use a "state machine" as this would involve duplicating a lot of code, making it harder to edit in the future. Thanks for everyone's help.

6

Montag, 16. September 2013, 05:35

I use "get(scene[get(xml.scene)].name))" to get name of scene but it not return exactly. E.x: in xml, name of scene is "scene_IMG_2752_Panorama" but it return "scene_img_2752_panorama".

7

Montag, 16. September 2013, 11:38

use additional attribute
"title" for example
additional attributes are keysensitive

Regards
Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN