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.

1

Wednesday, January 20th 2016, 11:07am

how to dynamiclly add hotspot to a scene

In each scene, I setted direction hotspots, now I want to dynamiclly add hotspot tip under the direction hotspot;
for example:

Source code

1
2
3
4
5
6
7
<scene name="scene_1" title="Entrace" onstart="" thumburl="../panos/1.tiles/thumb.jpg" lat="29.03297222" lng="115.94229722" heading="208.0">
		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />
		<preview url="../panos/1.tiles/preview.jpg" />
		<image>			<cube url="../panos/1.tiles/pano_%s.jpg" />			<mobile>				<cube url="../panos/1.tiles/mobile_%s.jpg" />			</mobile>		</image>
<hotspot name="spot1" style="skin_hotspotstyle" ath="-10" atv="22.536" linkedscene="scene_2" />
	    <hotspot name="spot3" style="skin_hotspotstyle" ath="20" atv="22.536" linkedscene="scene_3" 	       />
	</scene>


use addhotsopt() can and custom hotsopt, but how can I add the custom hotspot to the scene_1, the hotspot doesn't have parent attribute

jordi

Intermediate

Posts: 509

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Wednesday, January 20th 2016, 11:41am

Hotspots are created every time you get inside a scene, that's why they don't have parent attribute..


so for adding a tooltip hotspot dynamically, you can just say on the style of your direction hotspots

onover="addhotspot();"

and then find a way in order to relate the infos




<hotspot name="spot3" style="skin_hotspotstyle" tooltip="test tooltip">


then you would say :


onover="


addhotspot(hotspotTooltip);

set(hotspot[tooltip].url, textfield);
copy(hotspot[tooltip].html, hotspot[get(name)].tooltip);


"


onout="tween(hotspot[tooltip].alpha, 0, , , removehotspot(tooltip));"


The basic attributes (keep, x, y, ...) I did not writte but as basic structure it should work...


Hope it helps
everpano.com step beyond 360

3

Thursday, January 21st 2016, 4:25am

Thank a lot, it workes! *thumbsup* *thumbsup*