
Darkhog presents...The Hotspot behavior! What hotspot is?If you know what hotspot is, jump to next section. If you used earlier The Games Factory/MultiMedia Fusion, you probab ly know what hotspot is.
Hotspot is a point on the object (actor) from what the position is shown.
In Stencyl the position of "system" hotspot is 0,0 (related to actor space, so 0,0 (in pixels) of first frame of animation is hotspot).

This behavior is created to allow to define different hotspots for different animations (one hotspot per animation).

Of course you could add values to x/y of Actor (which is position of Actor's hotspot which is 0,0 related to actor image) to get similar result, but this is easier.
How to use this behavior?Well, after attaching to actor and configuring (Help and list's format are in field descriptions, anyway I'll giveout list format again: animation name,xofhotspot,yofhotspot. Animation name mustn't contain ","). you have access to several local custom blocks:

Now we should explain them.

These are pretty ordinary blocks which return Number with x/y of actor. These add necessary offset to builtin x/y getters to include hotspot position. So basically the formula is actor position (x OR y) + hotspot position for current animation.


These blocks sets X/Y of actor with hotspot applied. So if, for example hotspot is 10px far from left of actor's animation's image and 10px from top, these blocks will set position of this point as is would be 0,0 of image (Stencyl's built-in hotspot).
What is purpose of it?Shmups, shooters and other kinds of games where creating actors on
specific position is needed (for example on tip of your gun). Now you can have different animations for different types of weapons and you'll know where to create bullet when specific animation is playing for actor. Don't know how setters would be usable, but made it anyway figuring out, that someone may need them.
Limitations?Yes. You can't use these blocks from other actors (but it may be omitted by messaging system). So if you have actors named "a" and "b" you can't check hotspot position of actor "a" from behavior attached to actor "b" without using messages. The only other solution (except messages) I can think of is built-in hotspot support which hopefully will came soon to Stencyl.
//edit: After reconsidering I think Actor Values and Game Attributes may also help with getting hotspotted position of actor "a" from actor "b".