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 .

  • 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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!