DbOffsetSprite

This command resets the point at which a sprite is positioned.

Syntax
void dbOffsetSprite ( int iSprite, int iX, int iY )

Usage
This command translates the positioning point of a sprite to a new location. By default a sprite's position is determined by the top left corner of the sprite. It may be preferable to use another point within the sprite as the positioning reference.

iSprite is the number of a sprite known to the Dark GDK system.

iX is an integer designating the horizontal offset of the positioning point.

iY is an integer designating the vertical offset of the positioning point.

// assuming we'll be manipulating sprite number 1 int sWidth = dbSpriteWidth (1); int sHeight = dbSpriteHeight (1); dbOffsetSprite (1, sWidth/2, sHeight/2);

The preceding code sets the tracking point of the sprite such that it will position itself around a point that resides at its center. The sprite would appear half its width to the left and half its height upward from where it normally would display.