You are not logged in.

1

Wednesday, July 25th 2012, 10:25am

How to dynamically add a hotspot to current scene, and keep in that current scene only?

I have a xml with various scenes and hotspots. I currently have functionality to add hotspots dynamically. However, how can I have it so that my dynamically added hotspot stays in the scene I added it to, so that when I go to a different scene, I can't see the hotspot, but when I go back it's there again?

Sample action that I'm currently using:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
	<action name="addlocation">
		removelocation(get(location));
		removehotspot(get(location));
		addhotspot(get(location));
		set(hotspot[get(location)].url,/location.png);
		set(hotspot[get(location)].ath,get(view.hlookat));
		set(hotspot[get(location)].atv,get(view.vlookat));
		set(hotspot[get(location)].height,30);
		set(hotspot[get(location)].width,30);
		set(hotspot[get(location)].edge,center);

		js(addPoint(get(location), get(view.hlookat), get(view.vlookat)));
	</action>

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

2

Wednesday, July 25th 2012, 11:20am

Hi!If you set "keep" attribute to false then this plugin/hotspot will disapear after load/reload scene

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

3

Wednesday, July 25th 2012, 11:57am

Hey Andrey :)

I knew about keep false, which indeed does the trick with removing the hotspot when I change scene, however when I come back to the scene where I added it, it's also still disappeared (I want it to be kept, but only for that current scene).

Cheers,
Sam

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

4

Wednesday, July 25th 2012, 12:01pm

i!
Ok, as you know you must out this tag into scene tag.
any way
if you want add hotspot dynamically and only in some special scene
then just call hotpost_Add_action everytime you load this scene
call this action in onstart event
scene name="bal" onstart="dinamic_add_hotspot(blabla);"


that's all


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