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.

HansNyb

Professional

  • "HansNyb" started this thread

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

1

Monday, January 3rd 2011, 2:46pm

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

Intermediate

Posts: 277

Location: Kobyłka, Poland

Occupation: Virtual Tours - Spherical Panoramas - Krpano developer

  • Send private message

2

Monday, January 3rd 2011, 7:41pm

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

3

Monday, January 3rd 2011, 8:21pm

Hi,

you could do something like that:

Source code

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

Professional

  • "HansNyb" started this thread

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

4

Wednesday, January 5th 2011, 11:27am

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

VN2009

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

5

Wednesday, January 5th 2011, 3:20pm

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

Professional

  • "HansNyb" started this thread

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

6

Wednesday, January 5th 2011, 4:10pm

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

VN2009

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

7

Wednesday, January 5th 2011, 6:11pm

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.