Sprite is a pointer to a data structure which contains the following data. This data type can be used to define something with a picture which moves frequently. Sprite can contain an animation which can be update through UpdateSprite or UpdateSpriteAnimation. All sprites must be created using CreateSprite routine and must be freed with FreeSprite when you are finished with it.
- x (Single) - X coordinate
- y (Single) - Y coordinate
- xPos (Pointer to x) - X coordinate, kept for compatibility with previous versions
- yPos (Pointer to y) - Y coordinate, kept for compatibility with previous versions
- movement (Vector) - Movement vector - see note for modifying from .NET or VB6
- mass (Single) - Mass
- hasEnded (Boolean) - True if this sprite has finished animating
- The internal data may be modified by the SwinGame API, take care when modifying these values.
- C#, VB.Net and VB6 does not have an access to some internal data
- Movement can be set from .NET and VB6 using sprite.Movement.SetTo(vector), or by accessing the individual parts of the vector e.g. sprite.Movement.x += 1
- Note|x and y are new in version 1.1 Use these rather than xPos and yPos
Where is it: SGSDK_CORE