SetSpriteHotspot

Category: Images and Rendering

Back to System Functions


Signature

SetSpriteHotspot(spriteReference As Integer, x As Integer, y As Integer)

Returns

Void

Description

Sets the draw hotspot of a loaded sprite in pixels.

After this call, DrawSprite and DrawSpriteEx use the supplied x and y hotspot for every frame in the sprite sheet.

The hotspot may be negative or outside the frame bounds. New sprites start with a hotspot of 0, 0.

Example

hero = LoadSprite("player.png", 32, 32) SetSpriteHotspot(hero, 16, 24) DrawSprite(hero, 0, 100, 200)