GetSpriteStateHotspot
From OxeyeWiki
video.getSpriteStateHotspot(spriteId) | ||
Fetches the origo of a sprite state. This position is usually (0, 0) (the upper left corner of the animation), but sometimes the hotspot has been moved. For example, a character in a isometric view usually has the hotspot between the feet. | ||
Parameter | Expected Type | Description |
spriteId | An integer | The ID of the sprite state. This id IS retrieved when calling createSpriteState. |
Returns | ||
Returns two values, x and y, which is the position relative to the upper left corner of the sprite. The method will return nil in case the sprite state doesn't exist. |
Example
local x,y = video.getSpriteStateHotspot(sprite)