AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite Methods

The methods of the TAgkSprite class are listed here.

 
Name 
Description 
 
Adds an image to the sprite as a new animation frame. 
 
Adds a new box shape to the sprite, in addition to any it already has. These additional shapes only apply to physics sprites and must be added after a sprite has been set to use physics. 
 
Adds a new circle shape to the sprite, in addition to any it already has. These additional shapes only apply to physics sprites and must be added after a sprite has been set to use physics. 
 
Adds a new polygon shape to the sprite, in addition to any it already has. These additional shapes only apply to physics sprites and must be added after a sprite has been set to use physics. 
 
 
 
Recalculates the center of mass (COM) based on the shapes attached to the sprite, if you have overriden the COM this will set it back to a location decided by the AGK. 
 
Removes all animation frames from a sprite returning it to a single image sprite. 
 
Removes all additional shapes applied to the sprite and keeps only the base shape, set using the Shape property or SetShape* method. 
 
This is the overview for the Clone method overload. 
 
Checks two sprites for collision, if they overlap then it returns True. Otherwise it returns False. No other information can be returned about this type of collision. 
 
Checks two sprites for collision, if they overlap then it returns True. Otherwise it returns False. No other information can be returned about this type of collision. 
 
Creates a blank sprite. 
 
Creates a dummy sprite. Dummy sprites behave as normal sprites but have no image or other visual aspect to them. They will not be drawn even if an image is assigned to them. 
 
This is the overview for the Distance method overload. 
 
Draw 
Immediately draws the sprite to the backbuffer at its current position, size, and rotation. 
 
If you only have an internal AGK sprite ID, then you can use this function to get the sprite object for this ID. 
 
Hit 
This is the overview for the Hit method overload. 
 
This is the overview for the HitCategory method overload. 
 
This is the overview for the HitGroup method overload. 
 
This is the overview for the HitTest method overload. 
 
This is the overview for the InBox method overload. 
 
This is the overview for the InCircle method overload. 
 
Checks two sprites for a physics sprites. 
 
Checks two sprites for a physics sprites. 
 
Turns off physics for this sprite and deletes all associated physics settings for this sprite. 
 
This is the overview for the PixelFromPoint method overload. 
 
Play 
Begins the animation of a sprite based on the given values. 
 
This is the overview for the PointFromPixel method overload. 
 
This command reinstates the normal functionality of UV coordinates after a call to SetUV
 
Continues the animation of the sprite using the values used to set it up. 
 
Initialises the sprite animation with frames from its assigned image, based on a frame width and frame height. 
 
Assigns or removes a sprite from a particlar category. 
 
Sets or removes a category that this sprite can collide with. 
 
This is the overview for the SetColor method overload. 
 
Flips the sprite either horizontally or vertically, (or both). 
 
Change the sprite image to a new image, and update the collision shape accordingly. 
 
This is the overview for the SetOffset method overload. 
 
This is the overview for the SetPhysicsCenterOfMass method overload. 
 
Applies a force to the sprite that will last for this frame only, to continue applying this force you must keep calling this function. 
 
Similar to a force but applied only once. 
 
This is the overview for the SetPhysicsVelocity method overload. 
 
This is the overview for the SetPosition method overload. 
 
This is the overview for the SetPositionByOffset method overload. 
 
Sets the sprite scale as an absolute multiple of its original size. For example a scale value of 2 would double the sprite's size whilst a value of 1 will return it to its original size. 
 
Sets the sprite scale as an absolute multiple of its original size. For example a scale value of 2 would double the sprite's size whilst a value of 1 will return it to its original size. 
 
This is the overview for the SetScissor method overload. 
 
Overrides the current auto generated shape for use in collision detection, hit testing, and physics. Sets the shape to a box. 
 
Overrides the current auto generated shape for use in collision detection, hit testing, and physics. Sets the shape to a circle. 
 
Overrides the current auto generated shape for use in collision detection, hit testing, and physics. Set the shape to a polygon. 
 
Sets the sprite to a new width and height. In the default coordinate system a width and height of 100,100 would fill the entire drawable screen (this can be changed using TAgkApplication.SetVirtualResolution). 
 
This command overrides the normal UV calculations of the sprites and allows you to set them directly for each vertex. 
 
Offsets the sprites UV coordinates by the given amount. For example, offsetting by 0.5 in the U direction will make the sprite begin sampling the texture halfway across the top of the texture instead of the top left corner as normal. 
 
Scales the sprites UV coordinates by the given amount. A sprite with UV scaled by 2 will make its texture look twice as big as normal. 
 
Stop 
Stops the animation of a sprite, maintaining the values used to set it up. 
Copyright (c) 2012. All rights reserved.