Sie sind nicht angemeldet.

HansNyb

Profi

  • »HansNyb« ist der Autor dieses Themas

Beiträge: 1 063

Wohnort: Denmark

Beruf: Photographer

  • Nachricht senden

1

Montag, 3. Januar 2011, 14:46

Using title as showtext on hotspots

I tried to make a code for generating an automatic showtext above hotspots and taking the title from the linked scene.
I did not succeed so I had to do it manually for 30 hotspots.

But is is possible to do in the same way as for the VTour thumbnails. Would save a lot of time next time.

Hans

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

2

Montag, 3. Januar 2011, 19:41

Could you show the tour you are talking about? I mean the xml file you want to modify.

3

Montag, 3. Januar 2011, 20:21

Hi,

you could do something like that:

Quellcode

1
showtext(get(scene[scenename].title),textstyle);


where "scenename" is the name of the <scene> tag from where it should use the "title" attribute,

best regards,
Klaus

HansNyb

Profi

  • »HansNyb« ist der Autor dieses Themas

Beiträge: 1 063

Wohnort: Denmark

Beruf: Photographer

  • Nachricht senden

4

Mittwoch, 5. Januar 2011, 11:27

scene>


But that means I have to manually edit the scene name for each. Does not really give me any automatism. I can just as well do as I do now and write the title manually.

What I meant was the same as I use for the automatic thumbnails. were you automatically fetches the title from the linked scene.

Hans

5

Mittwoch, 5. Januar 2011, 15:20

i think scene counts start at scene0 or scene _0. would this not work?

showtext(get(scene[scene_0].title),textstyle);

using that as the onhover of a hotspot will get the title of the scene it is targeting.

HansNyb

Profi

  • »HansNyb« ist der Autor dieses Themas

Beiträge: 1 063

Wohnort: Denmark

Beruf: Photographer

  • Nachricht senden

6

Mittwoch, 5. Januar 2011, 16:10

i think scene counts start at scene0 or scene _0. would this not work?

showtext(get(scene[scene_0].title),textstyle);

using that as the onhover of a hotspot will get the title of the scene it is targeting.


Thanks, this works like this

<hotspot name="spot1" style="hotspot_ani_black"
ath="0"
atv="0"
zoom="false"
onhover="showtext(get(scene[scene_01].title),textstyle);"
onclick="looktohotspot(get(name)); loadscene('scene_01',null,MERGE,BLEND(1));"
/>

It would be nice if the template for this could be automatically generated in the Vtour. I actually believed I could config that but I can see now that there is no template for doing this.


BTW there is a weird way the scene names are loaded.
The startup action says this
<action name="startup">
<!-- load the first scene -->
loadscene(get(scene[0].name), null, MERGE);

But the first scene which is loaded from this is named scene_01 and if you want scene 02 to load you have to change it to get(scene[1]
It does not make sense.

Hans

7

Mittwoch, 5. Januar 2011, 18:11

loadscene(get(scene[0].name), null, MERGE);

Hans i think this setting is loading the scenes via the scene.count and not the scene name. I agree it does seem a little confusing. I could be wrong.