FANDOM


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

SyntaxEdit

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

UsageEdit

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.

See AlsoEdit

dbSprite
dbSpriteX
dbSpriteY
dbSpriteOffsetX
dbSpriteOffsetY
dbSpriteWidth
dbSpriteHeight

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.