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

Monday, June 10th 2019, 7:45am

set the hotspot's belong in scene by javascript

```
krpano.call("addhotspot(" + spotname + ")")
krpano.set("hotspot[" + spotname + "].url", './comment/messagebox.png')
krpano.set("hotspot[" + spotname + "].ath", h)
krpano.set("hotspot[" + spotname + "].atv", v)
krpano.set("hotspot[" + spotname + "].scale", 0.3)
krpano.set("hotspot[" + spotname + "].parent", 'scene[' + scene + ']')
krpano.set("hotspot[" + spotname + "].keep", 'false')
```

when I use javascript to inert hotspot in some scene, How can I set the hotspot belong to the scene , All the hotspots are show in the first scene now .

light_line

Trainee

Posts: 75

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

2

Monday, June 10th 2019, 9:38am

when you add a hotspot to Krpano, it will be added to the active scene and it is not possible to set any target scene.
also when the user changes the scene, your created hotspot will be terminated automatically.

3

Saturday, June 15th 2019, 2:48pm

Hi,

a scene is like an 'inlined/embedded' pano xml string.

The content of a <scene> element only gets parsed in objects and loaded when the actual scene will be loaded.

To 'add' something to a scene before it gets loaded would be possible by adding an string (e.g. like '<hotspot ... />') to the scene[NAME].content variable before calling loadscene() or using an action that will be called after loading the scene that addes the elements by action code.

Best regards,
Klaus