GetSpriteStateHotspot

From OxeyeWiki

Revision as of 15:21, 5 March 2009 by Jeb (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Daisymoon Video Lib

Example

   local x,y = video.getSpriteStateHotspot(sprite)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox