I noticed a lot of questions around how to manipulate hotspots when certain conditions are met. For some users, the "onviewchange" is not easy to grasp and the usage also has its limitations and can become complex quickly if a lot of things need to be verified within that routine.
To make it easier and more in line with the krpano event system, I created this plugin to help krpano coders with some very specific but common tasks/interactions with hotspots:
- do something when (not) looking at hotspots
- do something when the hotspot becomes (not) visible
- do something when you get far/close to a hotspot
Example usage:
<hotspot name="myhotspot1" lookatrange="30" onlookat="dosomething()" onlookout="dosomethingelse()" />
<hotspot name="myhotspot2" hittest="true" onvisiblein="dosomething()" onvisibleout="dosomethingelse()" />
<hotspot name="myhotspot3" geofencedistance="750" ongeofencein="dosomething()" ongeofenceout="dosomethingelse()" />
And all these can be combined in a single hotspot too...
In addtion, these properties are available when using the above events:
hotspot[name].lookstate
hotspot[name].anglefromcam
hotspot[name].inview
hotspot[name].geofencestate
hotspot[name].distancefromcam
More details on usage and download can be found on this gumroad page:
https://krisoft.gumroad.com/l/bpcaa
Online Demo: https://krpano.kri-soft.be/spacial/
IMPORTANT NOTE: this is still in development: I'm releasing this preview in order to gather feedback and maybe catch some unnoticed bugs. During this preview, a small overlay is displayed on top of the screen. As soon as the plugin is released, this overlay will be removed.
Would be nice if some of you could give this a test run on their own use cases.
Thank you for your feedback, this forum has been great to interact with!
kme