Sie sind nicht angemeldet.

1

Montag, 10. Juni 2019, 07:45

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

Fortgeschrittener

Beiträge: 169

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

  • Nachricht senden

2

Montag, 10. Juni 2019, 09:38

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

Samstag, 15. Juni 2019, 14:48

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