Component_ImageMap Class
A component which turns a game object into an interactive image-map.
Item Index
Methods
Properties
Methods
dispose
()
Initializes the image-map. Frees ground image.
executeHotspotAction
-
hotspot
Executes a hotspot's associated action. Depending on the configuration a hotspot can trigger a common-event or turn on a switch for example.
Parameters:
-
hotspot
gs.Object_Picture- The hotspot where the image should be updated.
onDataBundleRestore.
-
Object
-
gs.ObjectCodecContext
Called if this object instance is restored from a data-bundle. It can be used re-assign event-handler, anonymous functions, etc.
Parameters:
-
Object
Objectdata - The data-bundle
-
gs.ObjectCodecContext
Objectcontext - The codec-context.
setup
()
Initializes the image-map. Creates the background and hotspots.
setupEventHandlers
()
Adds event-handler for mouse/touch events to update the component only if a user-action happened.
setupHotspots
()
Sets up the hotspots on the image-map. Each hotspot is a gs.Object_ImageMapHotspot object.
update
()
Updates the image-map's ground and all hotspots.
updateGround
()
protected
Updates the ground-image.
updateHotspot
-
hotspot
Updates a hotspot.
Parameters:
-
hotspot
gs.Object_Picture- The hotspot to update.
updateHotspotAction
-
hotspot
Checks if a hotspot's associated action needs to be executed. Depending on the configuration a hotspot can trigger a common-event or turn on a switch for example.
Parameters:
-
hotspot
gs.Object_Picture- The hotspot where the image should be updated.
Returns:
If true the hotspot's action needs to be executed. Otherwise false.
updateHotspotImage
-
hotspot
-
hovered
Updates a hotspot's image. Depending on the state the image of a hotspot can change for example if the mouse hovers over a hotspot.
Parameters:
-
hotspot
gs.Object_Picture- The hotspot where the image should be updated.
-
hovered
Boolean- Indicates if the hotspot is hovered by mouse/touch cursor.
Properties
active
Boolean
Indicates if the image-map is active. An in-active image-map doesn't respond to any input-event. Hover effects are still working.
Default: yes
ground
gs.Object_Picture
The ground/base image.
Default: null
hotspots
gs.Object_Picture
An array of different hotspots.
Default: null
variableContext
Object
The variable context used if a hotspot needs to deal with local variables.
Default: null