Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 30. August 2018, 19:07

how to WAIT (for secondary assets to LOAD)?

I've got some secondary assets (photos, plans, etc.) that are loaded each time a new pano scene is loaded.
A regular Wait(Load) works 95+% of the time but every once in a while, the new pano loads before the secondary assets are loaded and creates and bugs out (the window doesn't resize per the asset). Is there a way to halt xml execution until a particular layer is loaded?

Basic code flow is:
New pano scene is clicked
layers containing secondary assets are faded out
Wait (load)
URLs for the secondary assets are stored as custom scene attributes.
Replace layer URLS with those from new scene
>>>Can I wait here until new URLS are retrieved and we have new image heights and widths <<<
Resize overlay window based on layer[xxx].imagewidth and layer[xxx].imageheight
Fade new assets in.

2

Donnerstag, 30. August 2018, 20:36

So I've got something that seems to be working although it doesn't seem like a very elegant solution. If anyone has a better idea, I'm all ears!

New code flow is:
New pano scene is clicked
>>> Set(layer[xxx].imagewidth, 0); <<<
layers containing secondary assets are faded out

Replace layer URLS with those from new scene
>>> callwhen(layer[xxx].imagewidth != 0, assetsLoaded(); ); <<<


Everything afterwards, is moved to the assetsLoaded action.
Resize overlay window based on layer[xxx].imagewidth and layer[xxx].imageheight
Fade new assets in.

4

Freitag, 31. August 2018, 15:34

you have to use layer[xxx].onloaded
https://krpano.com/docu/xml/#layer.onloaded
Ah! I knew there had to be a better way. Thank you!