FANDOM


This command positions a sprite and associates it with an image number.

SyntaxEdit

void dbSprite ( int iSprite, int iX, int iY, int iImage )

UsageEdit

This command creates a sprite from an image and/or positions it at the specified (x,y) position. The image number must be one that the Dark GDK system recognizes as having previously been set with dbLoadImage.

iSprite represents an integer from 1 to 65535. It may be a number previously set, or it may be an entirely new number. If previously set, manipulation of the other three parameters can be used to reposition the sprite or to associate it with a different image.

iX is an integer value that represents the horizontal position of the sprite on the screen. The position, under normal circumstances is determined by the pixel/point in the top left corner of the sprite. Horizontal position begin on the left of the display, starting with zero, and increment to the right. The dbOffsetSprite command can be used to change this.

iY is an integer value that represents the vertical position of the sprite. The vertical position begins with zero at the top of the screen and increments downward.

iImage is an integer value that represents an image that is known to the Dark GDK system.

dbSprite (1, 300, 250, 2);

The above code establishes that a sprite designated with the number 1 should be known to the Dark GDK system. It will be displayed at 300 pixels to the right from the left of the display and 250 pixels down from the top of the screen. It will display the image that Dark GDK recognizes as bearing the number 2. If the system doesn't recognize image number 2 then sprite number 1 will not be established. Note that sprites and images are separate to the Dark GDK, and may bear the same numbers.

Other considerationsEdit

Many other functions are available for manipulating different aspects of a sprite. This is one of only two functions that will reposition a sprite. The other is dbMoveSprite. However that command moves it relative to it's current position and is dependent on the angle set for the sprite. Positioning of a sprite should be done using the dbSprite function unless you need to move it at an angle with a given speed and you don't feel comfortable manipulating the positioning yourself

See AlsoEdit

dbSetSprite
dbDeleteSprite
dbCloneSprite
dbShowSprite
dbHideSprite
dbHideAllSprites
dbShowAllSprites
dbMoveSprite
dbOffsetSprite
dbScaleSprite
dbSizeSprite
dbStretchSprite
dbRotateSprite
dbFlipSprite
dbMirrorSprite
dbPasteSprite
dbCreateAnimatedSprite
dbPlaySprite
dbSetSpriteFrame
dbSetSpritePriority
dbSetSpriteImage
dbSetSpriteAlpha
dbSetSpriteDiffuse
dbSetSpriteTextureCoord

dbSpriteExist
dbSpriteX
dbSpriteY
dbSpriteOffsetX
dbSpriteOffsetY
dbSpriteScaleX
dbSpriteScaleY
dbSpriteWidth
dbSpriteHeight
dbSpriteImage
dbSpriteMirrored
dbSpriteFlipped
dbSpriteHit
dbSpriteCollision
dbSpriteAngle
dbSpriteFrame
dbSpriteAlpha
dbSpriteRed
dbSpriteGreen
dbSpriteBlue
dbSpriteVisible

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.