SplashKit sprites are game elements that can be moved, and animated. Sprites are located at a position in the game, have a velocity, and an animation. The sprite can also have arbitary data associated with it for game specific purposes.
Functions
Call For All Sprites
Call For All Sprites
Call the supplied function for all sprites in the current pack.
- Parameters
-
Name Type Description Fn The sprite function to call on all sprites.
Val Float
The value passed to the function for each sprite.
- Signatures
-
void call_for_all_sprites(sprite_float_function *fn, float val)
public static void Sprite.CallForAllSprites(SpriteFloatFunction fn, float val); public static void SplashKit.CallForAllSprites(SpriteFloatFunction fn, float val);
procedure CallForAllSprites(fn: SpriteFloatFunction; val: Single)
def call_for_all_sprites_with_value(fn, val):
Call For All Sprites
Call the supplied function for all sprites in the current pack.
- Parameters
-
Name Type Description Fn The sprite function to call on all sprites.
- Signatures
-
void call_for_all_sprites(sprite_function *fn)
public static void Sprite.CallForAllSprites(SpriteFunction fn); public static void SplashKit.CallForAllSprites(SpriteFunction fn);
procedure CallForAllSprites(fn: SpriteFunction)
def call_for_all_sprites(fn):
Call On Sprite Event
Register a procedure to be called when an events occur on any sprite.
- Parameters
-
Name Type Description Handler The function to call when any sprite raises an event
- Signatures
-
void call_on_sprite_event(sprite_event_handler *handler)
public static void Sprite.CallOnSpriteEvent(SpriteEventHandler handler); public static void SplashKit.CallOnSpriteEvent(SpriteEventHandler handler);
procedure CallOnSpriteEvent(handler: SpriteEventHandler)
def call_on_sprite_event(handler):
Center Point
Returns the center point of the passed in sprite. This is based on the sprite's Position, Width and Height.
- Return Type
-
The center point of the sprite
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
point_2d center_point(sprite s)
public Point2D Sprite.CenterPoint { get } public static Point2D SplashKit.CenterPoint(Sprite s);
function CenterPoint(s: Sprite): Point2D
def center_point(s):
Create Sprite
-
Create Sprite
(
layer
:
Bitmap
) -
Create Sprite
(
layer
:
Bitmap
ani :Animation Script
) -
Create Sprite
(
bitmap_name
:
String
) -
Create Sprite
(
name
:
String
layer :Bitmap
) -
Create Sprite
(
name
:
String
layer :Bitmap
ani :Animation Script
) -
Create Sprite
(
bitmap_name
:
String
animation_name :String
)
Create Sprite
Creates a sprite for the passed in bitmap image. The sprite will use the cell information within the bitmap if it is animated at a later stage.
This version of create_sprite will initialise the sprite to use pixel level collisions, no animations, and have one layer named 'layer1'. This version of the constructor will assign a default name to the sprite for resource management purposes.
- Return Type
-
The new sprite with image.
- Parameters
-
Name Type Description Layer The bitmap for the sprite's image.
- Signatures
-
sprite create_sprite(bitmap layer)
public static Sprite SplashKit.CreateSprite(Bitmap layer); public Sprite(Bitmap layer);
function CreateSprite(layer: Bitmap): Sprite
def create_sprite(layer):
Create Sprite
Creates a sprite for the passed in bitmap image. The sprite will use the
cell information within the bitmap if it is animated at a later stage.
This version of Create Sprite
will initialise the sprite to use
pixel level collisions, the specified animation template, the layer have
name 'layer1'.
This version of the constructor will assign a default name to the sprite for resource management purposes.
- Return Type
-
The new sprite with image and animation script.
- Parameters
-
Name Type Description Layer The bitmap for the sprite's image.
Ani The animation script for the sprite's animations.
- Signatures
-
sprite create_sprite(bitmap layer, animation_script ani)
public static Sprite SplashKit.CreateSprite(Bitmap layer, AnimationScript ani); public Sprite(Bitmap layer, AnimationScript ani);
function CreateSprite(layer: Bitmap; ani: AnimationScript): Sprite
def create_sprite_with_animation(layer, ani):
Create Sprite
Creates a sprite for the passed in bitmap image. The sprite will use the cell information within the bitmap if it is animated at a later stage.
This version of create_sprite will initialise the sprite to use pixel level collisions, no animations, and have one layer named 'layer1'. This version of the constructor will assign a default name to the sprite for resource management purposes.
- Return Type
-
The new sprite with image.
- Parameters
-
Name Type Description Bitmap Name String
The name of the bitmap to use as the sprite's layer
- Signatures
-
sprite create_sprite(const string &bitmap_name)
public static Sprite SplashKit.CreateSprite(string bitmapName); public Sprite(string bitmapName);
function CreateSprite(const bitmapName: String): Sprite
def create_sprite_with_bitmap_named(bitmap_name):
Create Sprite
Creates a sprite for the passed in bitmap image. The sprite will use the cell information within the sprite if it is animated at a later stage. This version of create_sprite will initialise the sprite to use pixel level collisions, no animation, the layer have name 'layer1'.
- Return Type
-
The new sprite with image and name.
- Parameters
-
Name Type Description Name String
The name of the sprite for resource management.
Layer The bitmap for the sprite's image.
- Signatures
-
sprite create_sprite(const string &name, bitmap layer)
public static Sprite SplashKit.CreateSprite(string name, Bitmap layer); public Sprite(string name, Bitmap layer);
function CreateSprite(const name: String; layer: Bitmap): Sprite
def create_sprite_named(name, layer):
Create Sprite
Creates a sprite for the passed in bitmap image. The sprite will use the cell information within the sprite if it is animated at a later stage. This version of create_sprite will initialise the sprite to use pixel level collisions, the specified animation template, the layer have name 'layer1'.
- Return Type
-
The new sprite with image, animation, and name.
- Parameters
-
Name Type Description Name String
The name of the sprite for resource management.
Layer The bitmap for the sprite's image.
Ani The animation script for the sprite's animations.
- Signatures
-
sprite create_sprite(const string &name, bitmap layer, animation_script ani)
public static Sprite SplashKit.CreateSprite(string name, Bitmap layer, AnimationScript ani); public Sprite(string name, Bitmap layer, AnimationScript ani);
function CreateSprite(const name: String; layer: Bitmap; ani: AnimationScript): Sprite
def create_sprite_named_with_animation(name, layer, ani):
Create Sprite
Creates a sprite. The bitmapname is used to indicate the bitmap the sprite will use, and the animationname is used to indicate which animation_script to use.
- Return Type
-
The new sprite with the image and animation.
- Parameters
-
Name Type Description Bitmap Name String
The name of the bitmap to use as the sprite's image.
Animation Name String
The name of the animation script to use for this sprite.
- Signatures
-
sprite create_sprite(const string &bitmap_name, const string &animation_name)
public static Sprite SplashKit.CreateSprite(string bitmapName, string animationName); public Sprite(string bitmapName, string animationName);
function CreateSprite(const bitmapName: String; const animationName: String): Sprite
def create_sprite_with_bitmap_and_animation_named(bitmap_name, animation_name):
Create Sprite Pack
Create a new spritepack with a given name. This pack can then be selected and used to control which sprites are drawn/updated in the calls to drawallsprites and updateall_sprites.
- Parameters
-
Name Type Description Name String
The name of the new sprite pack.
- Signatures
-
void create_sprite_pack(const string &name)
public static void Sprite.CreateSpritePack(string name); public static void SplashKit.CreateSpritePack(string name);
procedure CreateSpritePack(const name: String)
def create_sprite_pack(name):
Current Sprite Pack
Returns the name of the currently selected sprite_pack.
- Return Type
-
String
The name of the current sprite pack.
- Signatures
-
string current_sprite_pack()
public static string Sprite.CurrentSpritePack(); public static string SplashKit.CurrentSpritePack();
function CurrentSpritePack(): String
def current_sprite_pack():
Draw All Sprites
draws all of the sprites in the current sprite pack. Packs can be switched to select between different sets of sprites.
- Signatures
-
void draw_all_sprites()
public static void Sprite.DrawAllSprites(); public static void SplashKit.DrawAllSprites();
procedure DrawAllSprites()
def draw_all_sprites():
Draw Sprite
Draw Sprite
Draws the sprite at its position in the game offset by a given amount. Only use this method when you want to draw the sprite displaced from its location in your game. Otherwise you should change the sprite's location and then use the standard ''draw_sprite'' routine.
- Parameters
-
Name Type Description S The sprite to draw.
Offset The amount to offset the sprite.
- Signatures
-
void draw_sprite(sprite s, const vector_2d &offset)
public void Sprite.DrawSprite(Vector2D offset); public static void SplashKit.DrawSprite(Sprite s, Vector2D offset);
procedure DrawSprite(s: Sprite; const offset: Vector2D)
def draw_sprite_offset_by(s, offset):
Draw Sprite
Draws the sprite at its location in the world. This is affected by the position of the camera and the sprites current location.
This is the standard routine for drawing sprites to the screen and should be used in most cases.
- Parameters
-
Name Type Description S The sprite to draw.
- Signatures
-
void draw_sprite(sprite s)
public void Sprite.DrawSprite(); public static void SplashKit.DrawSprite(Sprite s);
procedure DrawSprite(s: Sprite)
def draw_sprite(s):
Draw Sprite
Draws the sprite at its position in the game offset by a given amount. Only
use this method when you want to draw the sprite displaced from its location
in your game. Otherwise you should change the sprite's location and then
use the standard Draw Sprite
routine.
- Parameters
-
Name Type Description S The sprite to draw.
X Offset Double
The amount to offset on the x axis.
Y Offset Double
The amount to offset on the y axis.
- Signatures
-
void draw_sprite(sprite s, double x_offset, double y_offset)
public void Sprite.DrawSprite(double xOffset, double yOffset); public static void SplashKit.DrawSprite(Sprite s, double xOffset, double yOffset);
procedure DrawSprite(s: Sprite; xOffset: Double; yOffset: Double)
def draw_sprite_offset_x_y(s, x_offset, y_offset):
Free All Sprites
Releases all of the sprites that have been loaded.
- Signatures
-
void free_all_sprites()
public static void Sprite.FreeAllSprites(); public static void SplashKit.FreeAllSprites();
procedure FreeAllSprites()
def free_all_sprites():
Free Sprite
Free the resources associated with a sprite.
- Parameters
-
Name Type Description S The sprite to be destroyed.
- Signatures
-
void free_sprite(sprite s)
public void Sprite.FreeSprite(); public static void SplashKit.FreeSprite(Sprite s);
procedure FreeSprite(s: Sprite)
def free_sprite(s):
Free Sprite Pack
Frees the sprite pack and all of its sprites.
- Parameters
-
Name Type Description Name String
The name of the sprite pack to destroy.
- Signatures
-
void free_sprite_pack(const string &name)
public static void Sprite.FreeSpritePack(string name); public static void SplashKit.FreeSpritePack(string name);
procedure FreeSpritePack(const name: String)
def free_sprite_pack(name):
Has Sprite
Determines if SplashKit has a sprite for the supplied name. This checks against all sprites, those loaded without a name are assigned a default.
- Return Type
-
Boolean
True if you have created a sprite with this name.
- Parameters
-
Name Type Description Name String
The name of the sprite to locate.
- Signatures
-
bool has_sprite(const string &name)
public static bool Sprite.HasSprite(string name); public static bool SplashKit.HasSprite(string name);
function HasSprite(const name: String): Boolean
def has_sprite(name):
Has Sprite Pack
Indicates if a given sprite_pack has already been created.
- Return Type
-
Boolean
True if a sprite pack exists with the indicated name.
- Parameters
-
Name Type Description Name String
The name for the sprite pack.
- Signatures
-
bool has_sprite_pack(const string &name)
public static bool Sprite.HasSpritePack(string name); public static bool SplashKit.HasSpritePack(string name);
function HasSpritePack(const name: String): Boolean
def has_sprite_pack(name):
Move Sprite
Move Sprite
moves the sprite as indicated by its velocity. You can call this directly ot alternatively, this action is performed when the sprite is updated using the ''update_sprite'' routine.
- Parameters
-
Name Type Description S The sprite to move.
- Signatures
-
void move_sprite(sprite s)
public void Sprite.MoveSprite(); public static void SplashKit.MoveSprite(Sprite s);
procedure MoveSprite(s: Sprite)
def move_sprite(s):
Move Sprite
Moves the sprite a given distance based on the value passed in rather than based on the sprite's velocity. Typically this method is used to apply other movement actions to the sprite and the velocity of the sprite is used the intended movement of the sprite.
- Parameters
-
Name Type Description S The sprite to move.
Distance The vector that represents the direction and distance to move the sprite.
- Signatures
-
void move_sprite(sprite s, const vector_2d &distance)
public void Sprite.MoveSprite(Vector2D distance); public static void SplashKit.MoveSprite(Sprite s, Vector2D distance);
procedure MoveSprite(s: Sprite; const distance: Vector2D)
def move_sprite_by_vector(s, distance):
Move Sprite
Moves the sprite a percentage of a given distance based on the value passed in rather than based on the sprite's velocity. Typically this method is used to apply other movement actions to the sprite and the velocity of the sprite is used the intended movement of the sprite.
- Parameters
-
Name Type Description S The sprite to move.
Distance The vector that represents the direction and distance to move the sprite.
Pct Float
The percentage of the distance to move the sprite.
- Signatures
-
void move_sprite(sprite s, const vector_2d &distance, float pct)
public void Sprite.MoveSprite(Vector2D distance, float pct); public static void SplashKit.MoveSprite(Sprite s, Vector2D distance, float pct);
procedure MoveSprite(s: Sprite; const distance: Vector2D; pct: Single)
def move_sprite_by_vector_percent(s, distance, pct):
Move Sprite
Moves the sprite as indicated by a percentage of its velocity. You can call this directly ot alternatively, this action is performed when the sprite is updated using the ''update_sprite'' routines that require a percentage.
- Parameters
-
Name Type Description S The sprite to move.
Pct Float
The percentage of the sprite's velocity to move.
- Signatures
-
void move_sprite(sprite s, float pct)
public void Sprite.MoveSprite(float pct); public static void SplashKit.MoveSprite(Sprite s, float pct);
procedure MoveSprite(s: Sprite; pct: Single)
def move_sprite_percent(s, pct):
Move Sprite To
This method moves a sprite to a given position in the game.
- Parameters
-
Name Type Description S The sprite to move.
X Double
The sprite's new x location.
Y Double
The sprite's new y location.
- Signatures
-
void move_sprite_to(sprite s, double x, double y)
public void Sprite.MoveSpriteTo(double x, double y); public static void SplashKit.MoveSpriteTo(Sprite s, double x, double y);
procedure MoveSpriteTo(s: Sprite; x: Double; y: Double)
def move_sprite_to(s, x, y):
Select Sprite Pack
Selects the named spritepack (if it has been created). The selected spritepack determines which sprites are drawn and updated with the drawallsprites and updateallsprites code.
- Parameters
-
Name Type Description Name String
The name of the sprite pack to select.
- Signatures
-
void select_sprite_pack(const string &name)
public static void Sprite.SelectSpritePack(string name); public static void SplashKit.SelectSpritePack(string name);
procedure SelectSpritePack(const name: String)
def select_sprite_pack(name):
Sprite Add Layer
Adds a new layer to the sprite.
- Return Type
-
Integer
The index of the new layer.
- Parameters
-
Name Type Description S The sprite to add the layer to.
New Layer The new layer's bitmap.
Layer Name String
The name of the new layer.
- Signatures
-
int sprite_add_layer(sprite s, bitmap new_layer, const string &layer_name)
public int Sprite.SpriteAddLayer(Bitmap newLayer, string layerName); public static int SplashKit.SpriteAddLayer(Sprite s, Bitmap newLayer, string layerName);
function SpriteAddLayer(s: Sprite; newLayer: Bitmap; const layerName: String): Integer
def sprite_add_layer(s, new_layer, layer_name):
Sprite Add To Velocity
Alters the current velocity of the sprite, adding the passed in vector2d to the current velocity.
When the sprite is updated (see Update Sprite
)
this vector2d is used to move the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value The amount to add to the sprite's velocity.
- Signatures
-
void sprite_add_to_velocity(sprite s, const vector_2d &value)
public void Sprite.SpriteAddToVelocity(Vector2D value); public static void SplashKit.SpriteAddToVelocity(Sprite s, Vector2D value);
procedure SpriteAddToVelocity(s: Sprite; const value: Vector2D)
def sprite_add_to_velocity(s, value):
Sprite Add Value
Sprite Add Value
Adds a new kind of value to the sprite
- Parameters
-
Name Type Description S The sprite to change.
Name String
The name of the new value to store in the sprite.
- Signatures
-
void sprite_add_value(sprite s, const string &name)
public void Sprite.SpriteAddValue(string name); public static void SplashKit.SpriteAddValue(Sprite s, string name);
procedure SpriteAddValue(s: Sprite; const name: String)
def sprite_add_value(s, name):
Sprite Add Value
Adds a new kind of value to the sprite, setting the initial value to the value passed in.
- Parameters
-
Name Type Description S The sprite to change.
Name String
The name of the new value to store in the sprite.
Init Val Float
The initial value.
- Signatures
-
void sprite_add_value(sprite s, const string &name, float init_val)
public void Sprite.SpriteAddValue(string name, float initVal); public static void SplashKit.SpriteAddValue(Sprite s, string name, float initVal);
procedure SpriteAddValue(s: Sprite; const name: String; initVal: Single)
def sprite_add_value_with_default(s, name, init_val):
Sprite Anchor Point
Returns the anchor point of the sprite. This is the point around which the sprite rotates. This is in sprite coordinates, so as if the sprite is drawn at 0,0.
- Return Type
-
The anchor point of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
point_2d sprite_anchor_point(sprite s)
public Point2D Sprite.AnchorPoint { get } public static Point2D SplashKit.SpriteAnchorPoint(Sprite s);
function SpriteAnchorPoint(s: Sprite): Point2D
def sprite_anchor_point(s):
Sprite Anchor Position
The sprite anchor position, is the location of the anchor point in world coordinates, based upon the position of the sprite.
- Return Type
-
The location of the sprite's anchor point positioned at the sprite's location
- Parameters
-
Name Type Description S The sprite to find where the anchor is in world coordinates
- Signatures
-
point_2d sprite_anchor_position(sprite s)
public static Point2D Sprite.SpriteAnchorPosition(Sprite s); public static Point2D SplashKit.SpriteAnchorPosition(Sprite s);
function SpriteAnchorPosition(s: Sprite): Point2D
def sprite_anchor_position(s):
Sprite Animation Has Ended
Indicates if the sprites animation has ended.
- Return Type
-
Boolean
True if the sprite animation has ended.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
bool sprite_animation_has_ended(sprite s)
public bool Sprite.AnimationHasEnded { get } public static bool SplashKit.SpriteAnimationHasEnded(Sprite s);
function SpriteAnimationHasEnded(s: Sprite): Boolean
def sprite_animation_has_ended(s):
Sprite Animation Name
Returns the name of the sprite's current animation.
- Return Type
-
String
The name of the current animation.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
string sprite_animation_name(sprite s)
public string Sprite.SpriteAnimationName(); public static string SplashKit.SpriteAnimationName(Sprite s);
function SpriteAnimationName(s: Sprite): String
def sprite_animation_name(s):
Sprite At
Determines if a sprite is at a given point.
- Return Type
-
Boolean
True if the sprite is at the given point
- Parameters
-
Name Type Description S The sprite to test
Pt The point to check (in world coordinates)
- Signatures
-
bool sprite_at(sprite s, const point_2d &pt)
public static bool Sprite.SpriteAt(Sprite s, Point2D pt); public static bool SplashKit.SpriteAt(Sprite s, Point2D pt);
function SpriteAt(s: Sprite; const pt: Point2D): Boolean
def sprite_at(s, pt):
Sprite Bring Layer Forward
Sends the layer specified forward in the visible layer order.
- Parameters
-
Name Type Description S The sprite to change
Visible Layer Integer
The visible layer to bring forward
- Signatures
-
void sprite_bring_layer_forward(sprite s, int visible_layer)
public void Sprite.SpriteBringLayerForward(int visibleLayer); public static void SplashKit.SpriteBringLayerForward(Sprite s, int visibleLayer);
procedure SpriteBringLayerForward(s: Sprite; visibleLayer: Integer)
def sprite_bring_layer_forward(s, visible_layer):
Sprite Bring Layer To Front
Sends the layer specified to the front in the visible layer order.
- Parameters
-
Name Type Description S The sprite to change
Visible Layer Integer
The visible layer to bring to the front
- Signatures
-
void sprite_bring_layer_to_front(sprite s, int visible_layer)
public void Sprite.SpriteBringLayerToFront(int visibleLayer); public static void SplashKit.SpriteBringLayerToFront(Sprite s, int visibleLayer);
procedure SpriteBringLayerToFront(s: Sprite; visibleLayer: Integer)
def sprite_bring_layer_to_front(s, visible_layer):
Sprite Call On Event
Register a procedure to call when events occur on the sprite.
- Parameters
-
Name Type Description S The sprite to add the handler to.
Handler The function to call when this sprite raises an event.
- Signatures
-
void sprite_call_on_event(sprite s, sprite_event_handler *handler)
public void Sprite.SpriteCallOnEvent(SpriteEventHandler handler); public static void SplashKit.SpriteCallOnEvent(Sprite s, SpriteEventHandler handler);
procedure SpriteCallOnEvent(s: Sprite; handler: SpriteEventHandler)
def sprite_call_on_event(s, handler):
Sprite Circle
Gets a circle in the bounds of the base layer of the indicated sprite.
- Return Type
-
A bounding circle that surrounds the sprite
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
circle sprite_circle(sprite s)
public Circle Sprite.SpriteCircle(); public static Circle SplashKit.SpriteCircle(Sprite s);
function SpriteCircle(s: Sprite): Circle
def sprite_circle(s):
Sprite Collision Bitmap
Returns the bitmap used by the sprite to determine if it has collided with other objects in the game.
- Return Type
-
The bitmap used for collisions with this sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
bitmap sprite_collision_bitmap(sprite s)
public Bitmap Sprite.CollisionBitmap { get } public static Bitmap SplashKit.SpriteCollisionBitmap(Sprite s);
function SpriteCollisionBitmap(s: Sprite): Bitmap
def sprite_collision_bitmap(s):
Sprite Collision Circle
Gets a circle in the bounds of the indicated sprite's collision rectangle.
- Return Type
-
A bounding circle that surrounds the sprite
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
circle sprite_collision_circle(sprite s)
public Circle Sprite.SpriteCollisionCircle(); public static Circle SplashKit.SpriteCollisionCircle(Sprite s);
function SpriteCollisionCircle(s: Sprite): Circle
def sprite_collision_circle(s):
Sprite Collision Kind
Returns the kind of collision used with this sprite. This is used when determining if the sprite has collided with other objects in the game.
- Return Type
-
The kind of collisions performed with this sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
collision_test_kind sprite_collision_kind(sprite s)
public CollisionTestKind Sprite.CollisionKind { get } public static CollisionTestKind SplashKit.SpriteCollisionKind(Sprite s);
function SpriteCollisionKind(s: Sprite): CollisionTestKind
def sprite_collision_kind(s):
Sprite Collision Rectangle
Returns the collision rectangle for the specified sprite.
- Return Type
-
A collision rectangle that surrounds the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
rectangle sprite_collision_rectangle(sprite s)
public Rectangle Sprite.CollisionRectangle { get } public static Rectangle SplashKit.SpriteCollisionRectangle(Sprite s);
function SpriteCollisionRectangle(s: Sprite): Rectangle
def sprite_collision_rectangle(s):
Sprite Current Cell
Returns the current animation cell for an animated sprite. The cell is updated when the sprite's animation data is updated.
- Return Type
-
Integer
The current cell animation of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
int sprite_current_cell(sprite s)
public int Sprite.CurrentCell { get } public static int SplashKit.SpriteCurrentCell(Sprite s);
function SpriteCurrentCell(s: Sprite): Integer
def sprite_current_cell(s):
Sprite Current Cell Rectangle
Returns a rectangle of the current cell within the sprite's image. This is used to determine what part of the bitmap should be used when the sprite is drawn.
- Return Type
-
The current cell rectangle of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
rectangle sprite_current_cell_rectangle(sprite s)
public Rectangle Sprite.CurrentCellRectangle { get } public static Rectangle SplashKit.SpriteCurrentCellRectangle(Sprite s);
function SpriteCurrentCellRectangle(s: Sprite): Rectangle
def sprite_current_cell_rectangle(s):
Sprite Dx
Returns the X value of the sprite's velocity.
- Return Type
-
Float
The x component of the sprite's velocity.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_dx(sprite s)
public float Sprite.Dx { get } public static float SplashKit.SpriteDx(Sprite s);
function SpriteDx(s: Sprite): Single
def sprite_dx(s):
Sprite Dy
Returns the Y value of the sprite's velocity.
- Return Type
-
Float
The y component of the sprite's velocity.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_dy(sprite s)
public float Sprite.Dy { get } public static float SplashKit.SpriteDy(Sprite s);
function SpriteDy(s: Sprite): Single
def sprite_dy(s):
Sprite Has Value
Indicates if the sprite has a value with the given name.
- Return Type
-
Boolean
True if the sprite has a value with that name.
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the value to check.
- Signatures
-
bool sprite_has_value(sprite s, string name)
public static bool Sprite.SpriteHasValue(Sprite s, string name); public static bool SplashKit.SpriteHasValue(Sprite s, string name);
function SpriteHasValue(s: Sprite; name: String): Boolean
def sprite_has_value(s, name):
Sprite Heading
Returns the direction the sprite is heading in degrees.
- Return Type
-
Float
The angle of the sprite velocity.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_heading(sprite s)
public float Sprite.Heading { get } public static float SplashKit.SpriteHeading(Sprite s);
function SpriteHeading(s: Sprite): Single
def sprite_heading(s):
Sprite Height
The current height of the sprite (aligned to the Y axis).
- Return Type
-
Integer
The height of the sprite in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
int sprite_height(sprite s)
public int Sprite.Height { get } public static int SplashKit.SpriteHeight(Sprite s);
function SpriteHeight(s: Sprite): Integer
def sprite_height(s):
Sprite Hide Layer
Sprite Hide Layer
Hide the specified layer of the sprite.
- Parameters
-
Name Type Description S The sprite to hide the layer of.
Name String
The name of the layer to hide.
- Signatures
-
void sprite_hide_layer(sprite s, const string &name)
public void Sprite.SpriteHideLayer(string name); public static void SplashKit.SpriteHideLayer(Sprite s, string name);
procedure SpriteHideLayer(s: Sprite; const name: String)
def sprite_hide_layer_named(s, name):
Sprite Hide Layer
Hide the specified layer of the sprite.
- Parameters
-
Name Type Description S The sprite to hide the layer of.
Id Integer
The index of the layer to hide.
- Signatures
-
void sprite_hide_layer(sprite s, int id)
public void Sprite.SpriteHideLayer(int id); public static void SplashKit.SpriteHideLayer(Sprite s, int id);
procedure SpriteHideLayer(s: Sprite; id: Integer)
def sprite_hide_layer(s, id):
Sprite Layer
Sprite Layer
Returns the bitmap of the indicated layer of the sprite.
- Return Type
-
The bitmap at the layer with the indicated name
- Parameters
-
Name Type Description S The sprite to get the layer from
Name String
The name of the layer to fetch
- Signatures
-
bitmap sprite_layer(sprite s, const string &name)
public Bitmap Sprite.SpriteLayer(string name); public static Bitmap SplashKit.SpriteLayer(Sprite s, string name);
function SpriteLayer(s: Sprite; const name: String): Bitmap
def sprite_layer_named(s, name):
Sprite Layer
Returns the bitmap of the indicated layer of the sprite.
- Return Type
-
The bitmap of the sprite at that layer
- Parameters
-
Name Type Description S The sprite to get the layer from
Idx Integer
The index of the layer
- Signatures
-
bitmap sprite_layer(sprite s, int idx)
public Bitmap Sprite.SpriteLayer(int idx); public static Bitmap SplashKit.SpriteLayer(Sprite s, int idx);
function SpriteLayer(s: Sprite; idx: Integer): Bitmap
def sprite_layer_at_index(s, idx):
Sprite Layer Circle
Sprite Layer Circle
Gets a circle in the bounds of the indicated layer.
- Return Type
-
A bounding circle that surrounds the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer.
- Signatures
-
circle sprite_layer_circle(sprite s, const string &name)
public Circle Sprite.SpriteLayerCircle(string name); public static Circle SplashKit.SpriteLayerCircle(Sprite s, string name);
function SpriteLayerCircle(s: Sprite; const name: String): Circle
def sprite_layer_circle_named(s, name):
Sprite Layer Circle
Gets a circle in the bounds of the indicated layer.
- Return Type
-
A bounding circle that surrounds the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the layer.
- Signatures
-
circle sprite_layer_circle(sprite s, int idx)
public Circle Sprite.SpriteLayerCircle(int idx); public static Circle SplashKit.SpriteLayerCircle(Sprite s, int idx);
function SpriteLayerCircle(s: Sprite; idx: Integer): Circle
def sprite_layer_circle_at_index(s, idx):
Sprite Layer Count
Returns the number of layers within the sprite.
- Return Type
-
Integer
The number of image layers in the sprite.
- Parameters
-
Name Type Description S The sprite to get the layer count from.
- Signatures
-
int sprite_layer_count(sprite s)
public int Sprite.LayerCount { get } public static int SplashKit.SpriteLayerCount(Sprite s);
function SpriteLayerCount(s: Sprite): Integer
def sprite_layer_count(s):
Sprite Layer Height
Sprite Layer Height
The height of a given layer of the sprite (aligned to the Y axis).
- Return Type
-
Integer
The height of the sprite's layer in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer to get the details of.
- Signatures
-
int sprite_layer_height(sprite s, const string &name)
public int Sprite.SpriteLayerHeight(string name); public static int SplashKit.SpriteLayerHeight(Sprite s, string name);
function SpriteLayerHeight(s: Sprite; const name: String): Integer
def sprite_layer_height_named(s, name):
Sprite Layer Height
The height of a given layer of the sprite (aligned to the Y axis).
- Return Type
-
Integer
The height of the sprite's layer in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the layer to get the details of.
- Signatures
-
int sprite_layer_height(sprite s, int idx)
public int Sprite.SpriteLayerHeight(int idx); public static int SplashKit.SpriteLayerHeight(Sprite s, int idx);
function SpriteLayerHeight(s: Sprite; idx: Integer): Integer
def sprite_layer_height(s, idx):
Sprite Layer Index
Returns the index of the specified layer.
- Return Type
-
Integer
The index of the layer in the sprite
- Parameters
-
Name Type Description S The sprite to get the layer from
Name String
The name of the layer to get the index of
- Signatures
-
int sprite_layer_index(sprite s, const string &name)
public int Sprite.SpriteLayerIndex(string name); public static int SplashKit.SpriteLayerIndex(Sprite s, string name);
function SpriteLayerIndex(s: Sprite; const name: String): Integer
def sprite_layer_index(s, name):
Sprite Layer Name
Returns the name of the specified layer.
- Return Type
-
String
The name of the sprite's layer at that index
- Parameters
-
Name Type Description S The sprite to get the layer name from
Idx Integer
The index of the layer you want the name of
- Signatures
-
string sprite_layer_name(sprite s, int idx)
public string Sprite.SpriteLayerName(int idx); public static string SplashKit.SpriteLayerName(Sprite s, int idx);
function SpriteLayerName(s: Sprite; idx: Integer): String
def sprite_layer_name(s, idx):
Sprite Layer Offset
Sprite Layer Offset
Gets the offset of the specified layer.
- Return Type
-
The offset of the named layer in the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer to get the offset of.
- Signatures
-
vector_2d sprite_layer_offset(sprite s, const string &name)
public Vector2D Sprite.SpriteLayerOffset(string name); public static Vector2D SplashKit.SpriteLayerOffset(Sprite s, string name);
function SpriteLayerOffset(s: Sprite; const name: String): Vector2D
def sprite_layer_offset_named(s, name):
Sprite Layer Offset
Gets the offset of the specified layer.
- Return Type
-
The offset of the layer in the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the layer to get the offset of.
- Signatures
-
vector_2d sprite_layer_offset(sprite s, int idx)
public Vector2D Sprite.SpriteLayerOffset(int idx); public static Vector2D SplashKit.SpriteLayerOffset(Sprite s, int idx);
function SpriteLayerOffset(s: Sprite; idx: Integer): Vector2D
def sprite_layer_offset(s, idx):
Sprite Layer Rectangle
Sprite Layer Rectangle
Gets a rectangle that surrounds the indicated layer.
- Return Type
-
A bounding rectangle that surrounds the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer.
- Signatures
-
rectangle sprite_layer_rectangle(sprite s, const string &name)
public Rectangle Sprite.SpriteLayerRectangle(string name); public static Rectangle SplashKit.SpriteLayerRectangle(Sprite s, string name);
function SpriteLayerRectangle(s: Sprite; const name: String): Rectangle
def sprite_layer_rectangle_named(s, name):
Sprite Layer Rectangle
Gets a rectangle that surrounds the indicated layer.
- Return Type
-
A bounding rectangle that surrounds the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the layer.
- Signatures
-
rectangle sprite_layer_rectangle(sprite s, int idx)
public Rectangle Sprite.SpriteLayerRectangle(int idx); public static Rectangle SplashKit.SpriteLayerRectangle(Sprite s, int idx);
function SpriteLayerRectangle(s: Sprite; idx: Integer): Rectangle
def sprite_layer_rectangle_at_index(s, idx):
Sprite Layer Width
Sprite Layer Width
The width of a given layer of the sprite (aligned to the X axis).
- Return Type
-
Integer
The width of the sprite's layer in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer to get the details of.
- Signatures
-
int sprite_layer_width(sprite s, const string &name)
public int Sprite.SpriteLayerWidth(string name); public static int SplashKit.SpriteLayerWidth(Sprite s, string name);
function SpriteLayerWidth(s: Sprite; const name: String): Integer
def sprite_layer_width_named(s, name):
Sprite Layer Width
The width of a given layer of the sprite (aligned to the X axis).
- Return Type
-
Integer
The width of the sprite's layer in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the layer to get the details of.
- Signatures
-
int sprite_layer_width(sprite s, int idx)
public int Sprite.SpriteLayerWidth(int idx); public static int SplashKit.SpriteLayerWidth(Sprite s, int idx);
function SpriteLayerWidth(s: Sprite; idx: Integer): Integer
def sprite_layer_width(s, idx):
Sprite Location Matrix
Returns a matrix that can be used to transform points into the coordinate space of the passed in sprite.
- Return Type
-
A matrix that transforms points into the sprites coordinate space.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
matrix_2d sprite_location_matrix(sprite s)
public Matrix2D Sprite.LocationMatrix { get } public static Matrix2D SplashKit.SpriteLocationMatrix(Sprite s);
function SpriteLocationMatrix(s: Sprite): Matrix2D
def sprite_location_matrix(s):
Sprite Mass
This indicates the mass of the sprite for any of the collide methods from Physics. The mass of two colliding sprites will determine the relative velocitys after the collision.
- Return Type
-
Float
The mass of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_mass(sprite s)
public float Sprite.Mass { get } public static float SplashKit.SpriteMass(Sprite s);
function SpriteMass(s: Sprite): Single
def sprite_mass(s):
Sprite Move From Anchor Point
Indicates if the sprite is moved from its anchor point, or from its top left. When this returns true the location of the sprite will indicate its anchor point. When this returns false the location of the sprite is its top left corner.
- Return Type
-
Boolean
True if the sprite moves from its anchor point.
- Parameters
-
Name Type Description S The sprite to get the details of.
- Signatures
-
bool sprite_move_from_anchor_point(sprite s)
public bool Sprite.MoveFromAnchorPoint { get } public static bool SplashKit.SpriteMoveFromAnchorPoint(Sprite s);
function SpriteMoveFromAnchorPoint(s: Sprite): Boolean
def sprite_move_from_anchor_point(s):
Sprite Move To
This void starts the sprite moving to the indicated destination point, over a specified number of seconds. When the sprite arrives it will raise the sprite_arrived event.
- Parameters
-
Name Type Description S The sprite to move.
Pt The sprite's destination.
Taking Seconds Float
The time the sprite should take to get to pt.
- Signatures
-
void sprite_move_to(sprite s, const point_2d &pt, float taking_seconds)
public void Sprite.SpriteMoveTo(Point2D pt, float takingSeconds); public static void SplashKit.SpriteMoveTo(Sprite s, Point2D pt, float takingSeconds);
procedure SpriteMoveTo(s: Sprite; const pt: Point2D; takingSeconds: Single)
def sprite_move_to_taking_seconds(s, pt, taking_seconds):
Sprite Name
Returns the name of the sprite. This name is used for resource management and can be used to interact with the sprite in various routines.
- Return Type
-
String
The name of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
string sprite_name(sprite s)
public string Sprite.Name { get } public static string SplashKit.SpriteName(Sprite s);
function SpriteName(s: Sprite): String
def sprite_name(s):
Sprite Named
Returns the Sprite
with the specified name.
- Return Type
-
The sprite with that name.
- Parameters
-
Name Type Description Name String
The name of the sprite to locate.
- Signatures
-
sprite sprite_named(const string &name)
public static Sprite Sprite.SpriteNamed(string name); public static Sprite SplashKit.SpriteNamed(string name);
function SpriteNamed(const name: String): Sprite
def sprite_named(name):
Sprite Offscreen
Returns true if the sprite is entirely off the current screen.
- Return Type
-
Boolean
True if the sprite is entirely off the current window.
- Parameters
-
Name Type Description S The sprite to test.
- Signatures
-
bool sprite_offscreen(sprite s)
public bool Sprite.SpriteOffscreen(); public static bool SplashKit.SpriteOffscreen(Sprite s);
function SpriteOffscreen(s: Sprite): Boolean
def sprite_offscreen(s):
Sprite On Screen At
Sprite On Screen At
Returns true if a pixel of the Sprite
S
is at the screen location
specified (Pt
), which is converted to a world location.
- Return Type
-
Boolean
True if the sprite would draw something at this coordinate on the screen when drawn.
- Parameters
-
Name Type Description S The sprite to test.
Pt The location in screen coordinates to check.
- Signatures
-
bool sprite_on_screen_at(sprite s, const point_2d &pt)
public bool Sprite.SpriteOnScreenAt(Point2D pt); public static bool SplashKit.SpriteOnScreenAt(Sprite s, Point2D pt);
function SpriteOnScreenAt(s: Sprite; const pt: Point2D): Boolean
def sprite_on_screen_at_point(s, pt):
Sprite On Screen At
Returns true if a pixel of the Sprite
S
is at the screen location
specified.
- Return Type
-
Boolean
True if the sprite would draw something at this coordinate on the screen when drawn.
- Parameters
-
Name Type Description S The sprite to test.
X Double
The x location in screen coordinates to check.
Y Double
The y location in screen coordinates to check.
- Signatures
-
bool sprite_on_screen_at(sprite s, double x, double y)
public bool Sprite.SpriteOnScreenAt(double x, double y); public static bool SplashKit.SpriteOnScreenAt(Sprite s, double x, double y);
function SpriteOnScreenAt(s: Sprite; x: Double; y: Double): Boolean
def sprite_on_screen_at(s, x, y):
Sprite Position
Returns the sprite's position.
- Return Type
-
The location of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
point_2d sprite_position(sprite s)
public Point2D Sprite.Position { get } public static Point2D SplashKit.SpritePosition(Sprite s);
function SpritePosition(s: Sprite): Point2D
def sprite_position(s):
Sprite Replay Animation
Sprite Replay Animation
Restart the sprite's current animation, this will play a sound if the first cell of the animation is associated with a sound effect.
- Parameters
-
Name Type Description S The sprite to replay the animation of.
- Signatures
-
void sprite_replay_animation(sprite s)
public void Sprite.SpriteReplayAnimation(); public static void SplashKit.SpriteReplayAnimation(Sprite s);
procedure SpriteReplayAnimation(s: Sprite)
def sprite_replay_animation(s):
Sprite Replay Animation
Restart the sprite's current animation, this will play a sound if with_sound is true and the first cell of the animation is associated with a sound effect.
- Parameters
-
Name Type Description S The sprite to replay the animation of.
With Sound Boolean
If false, the animation will not play associated sound effects when restarted.
- Signatures
-
void sprite_replay_animation(sprite s, bool with_sound)
public void Sprite.SpriteReplayAnimation(bool withSound); public static void SplashKit.SpriteReplayAnimation(Sprite s, bool withSound);
procedure SpriteReplayAnimation(s: Sprite; withSound: Boolean)
def sprite_replay_animation_with_sound(s, with_sound):
Sprite Rotation
This indicates the angle of rotation of the sprite. This will rotate any images of the sprite before drawing, which can be very slow. avoid using this method with bitmap based sprites where possible.
- Return Type
-
Float
The angle of the sprite rotation.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_rotation(sprite s)
public float Sprite.Rotation { get } public static float SplashKit.SpriteRotation(Sprite s);
function SpriteRotation(s: Sprite): Single
def sprite_rotation(s):
Sprite Scale
This indicates the scale of the sprite. This will scale any images of the sprite before drawing, which can be very slow. avoid using this method with bitmap based sprites where possible.
- Return Type
-
Float
The scale of the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_scale(sprite s)
public float Sprite.Scale { get } public static float SplashKit.SpriteScale(Sprite s);
function SpriteScale(s: Sprite): Single
def sprite_scale(s):
Sprite Screen Rectangle
Returns the rectangle representing the location of the sprite on the screen.
- Return Type
-
A rectangle indicating where the sprite is on the screen.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
rectangle sprite_screen_rectangle(sprite s)
public Rectangle Sprite.ScreenRectangle { get } public static Rectangle SplashKit.SpriteScreenRectangle(Sprite s);
function SpriteScreenRectangle(s: Sprite): Rectangle
def sprite_screen_rectangle(s):
Sprite Send Layer Backward
Sends the layer specified backward in the visible layer order.
- Parameters
-
Name Type Description S The sprite to change
Visible Layer Integer
The visible layer to send to backward
- Signatures
-
void sprite_send_layer_backward(sprite s, int visible_layer)
public void Sprite.SpriteSendLayerBackward(int visibleLayer); public static void SplashKit.SpriteSendLayerBackward(Sprite s, int visibleLayer);
procedure SpriteSendLayerBackward(s: Sprite; visibleLayer: Integer)
def sprite_send_layer_backward(s, visible_layer):
Sprite Send Layer To Back
Sends the layer specified to the back in the visible layer order.
- Parameters
-
Name Type Description S The sprite to change
Visible Layer Integer
The visible layer to send to back
- Signatures
-
void sprite_send_layer_to_back(sprite s, int visible_layer)
public void Sprite.SpriteSendLayerToBack(int visibleLayer); public static void SplashKit.SpriteSendLayerToBack(Sprite s, int visibleLayer);
procedure SpriteSendLayerToBack(s: Sprite; visibleLayer: Integer)
def sprite_send_layer_to_back(s, visible_layer):
Sprite Set Anchor Point
Allows you to set the anchor point for the sprite. This is the point around which the sprite rotates. This is in sprite coordinates, as if the sprite is drawn at 0,0.
- Parameters
-
Name Type Description S The sprite to change.
Pt The new anchor point in sprite coordinates.
- Signatures
-
void sprite_set_anchor_point(sprite s, const point_2d &pt)
public void Sprite.AnchorPoint { set } public static void SplashKit.SpriteSetAnchorPoint(Sprite s, Point2D pt);
procedure SpriteSetAnchorPoint(s: Sprite; const pt: Point2D)
def sprite_set_anchor_point(s, pt):
Sprite Set Collision Bitmap
Sets the bitmap used by the sprite to determine if it has collided with other objects in the game. By default the collision_bitmap is set to the bitmap from the sprite's first layer.
- Parameters
-
Name Type Description S The sprite to change.
Bmp The new collision bitmap for the sprite.
- Signatures
-
void sprite_set_collision_bitmap(sprite s, bitmap bmp)
public void Sprite.CollisionBitmap { set } public static void SplashKit.SpriteSetCollisionBitmap(Sprite s, Bitmap bmp);
procedure SpriteSetCollisionBitmap(s: Sprite; bmp: Bitmap)
def sprite_set_collision_bitmap(s, bmp):
Sprite Set Collision Kind
Sets the kind of collision used with this sprite. This is used when determining if the sprite has collided with other objects in the game.
- Parameters
-
Name Type Description S The sprite to change.
Value The new kind of collision test for this sprite.
- Signatures
-
void sprite_set_collision_kind(sprite s, collision_test_kind value)
public void Sprite.CollisionKind { set } public static void SplashKit.SpriteSetCollisionKind(Sprite s, CollisionTestKind value);
procedure SpriteSetCollisionKind(s: Sprite; value: CollisionTestKind)
def sprite_set_collision_kind(s, value):
Sprite Set Dx
Sets the X value of the sprite's velocity.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new x component of the sprite's velocity.
- Signatures
-
void sprite_set_dx(sprite s, float value)
public void Sprite.Dx { set } public static void SplashKit.SpriteSetDx(Sprite s, float value);
procedure SpriteSetDx(s: Sprite; value: Single)
def sprite_set_dx(s, value):
Sprite Set Dy
Sets the Y value of the sprite's velocity.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new y component of the sprite's velocity.
- Signatures
-
void sprite_set_dy(sprite s, float value)
public void Sprite.Dy { set } public static void SplashKit.SpriteSetDy(Sprite s, float value);
procedure SpriteSetDy(s: Sprite; value: Single)
def sprite_set_dy(s, value):
Sprite Set Heading
Alters the direction the sprite is heading without changing the speed.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new angle for the sprite's velocity -- distance remains the same.
- Signatures
-
void sprite_set_heading(sprite s, float value)
public void Sprite.Heading { set } public static void SplashKit.SpriteSetHeading(Sprite s, float value);
procedure SpriteSetHeading(s: Sprite; value: Single)
def sprite_set_heading(s, value):
Sprite Set Layer Offset
Sprite Set Layer Offset
Sets the offset of the specified layer. The offset is used when the layer is drawn in the sprite, and moves the image relative to the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Name String
The name of the layer to change.
Value The new offset.
- Signatures
-
void sprite_set_layer_offset(sprite s, const string &name, const vector_2d &value)
public void Sprite.SpriteSetLayerOffset(string name, Vector2D value); public static void SplashKit.SpriteSetLayerOffset(Sprite s, string name, Vector2D value);
procedure SpriteSetLayerOffset(s: Sprite; const name: String; const value: Vector2D)
def sprite_set_layer_offset_named(s, name, value):
Sprite Set Layer Offset
Sets the offset of the specified layer.
- Parameters
-
Name Type Description S The sprite to change.
Idx Integer
The index of the layer to change.
Value The new offset.
- Signatures
-
void sprite_set_layer_offset(sprite s, int idx, const vector_2d &value)
public void Sprite.SpriteSetLayerOffset(int idx, Vector2D value); public static void SplashKit.SpriteSetLayerOffset(Sprite s, int idx, Vector2D value);
procedure SpriteSetLayerOffset(s: Sprite; idx: Integer; const value: Vector2D)
def sprite_set_layer_offset_at_index(s, idx, value):
Sprite Set Mass
Allows you to change the mass of a sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new mass for the sprite.
- Signatures
-
void sprite_set_mass(sprite s, float value)
public void Sprite.Mass { set } public static void SplashKit.SpriteSetMass(Sprite s, float value);
procedure SpriteSetMass(s: Sprite; value: Single)
def sprite_set_mass(s, value):
Sprite Set Move From Anchor Point
Allows you to indicate if the sprite is moved from its anchor point, or from its top left.
When set to true the location of the sprite will be its anchor point. When set to false the location of the sprite is its top left corner.
- Parameters
-
Name Type Description S The sprite to change.
Value Boolean
The value to set this option.
- Signatures
-
void sprite_set_move_from_anchor_point(sprite s, bool value)
public void Sprite.MoveFromAnchorPoint { set } public static void SplashKit.SpriteSetMoveFromAnchorPoint(Sprite s, bool value);
procedure SpriteSetMoveFromAnchorPoint(s: Sprite; value: Boolean)
def sprite_set_move_from_anchor_point(s, value):
Sprite Set Position
Sets the sprite's position.
- Parameters
-
Name Type Description S The sprite to change.
Value The new location for the sprite.
- Signatures
-
void sprite_set_position(sprite s, const point_2d &value)
public void Sprite.Position { set } public static void SplashKit.SpriteSetPosition(Sprite s, Point2D value);
procedure SpriteSetPosition(s: Sprite; const value: Point2D)
def sprite_set_position(s, value):
Sprite Set Rotation
Allows you to change the rotation of a sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new rotation angle for the sprite
- Signatures
-
void sprite_set_rotation(sprite s, float value)
public void Sprite.Rotation { set } public static void SplashKit.SpriteSetRotation(Sprite s, float value);
procedure SpriteSetRotation(s: Sprite; value: Single)
def sprite_set_rotation(s, value):
Sprite Set Scale
Allows you to change the scale of a sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new scale for the sprite.
- Signatures
-
void sprite_set_scale(sprite s, float value)
public void Sprite.Scale { set } public static void SplashKit.SpriteSetScale(Sprite s, float value);
procedure SpriteSetScale(s: Sprite; value: Single)
def sprite_set_scale(s, value):
Sprite Set Speed
Alters the speed of the sprite without effecting the direction.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new speed of the sprite -- direction will remain the same.
- Signatures
-
void sprite_set_speed(sprite s, float value)
public void Sprite.Speed { set } public static void SplashKit.SpriteSetSpeed(Sprite s, float value);
procedure SpriteSetSpeed(s: Sprite; value: Single)
def sprite_set_speed(s, value):
Sprite Set Value
Assigns a value to the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Name String
The name of the value to change
Val Float
The new value.
- Signatures
-
void sprite_set_value(sprite s, const string &name, float val)
public void Sprite.SpriteSetValue(string name, float val); public static void SplashKit.SpriteSetValue(Sprite s, string name, float val);
procedure SpriteSetValue(s: Sprite; const name: String; val: Single)
def sprite_set_value_named(s, name, val):
Sprite Set Velocity
Sets the current velocity of the sprite. When the sprite is updated
(see Update Sprite
) this vector_2d is used to move the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value The new sprite velocity.
- Signatures
-
void sprite_set_velocity(sprite s, const vector_2d &value)
public void Sprite.Velocity { set } public static void SplashKit.SpriteSetVelocity(Sprite s, Vector2D value);
procedure SpriteSetVelocity(s: Sprite; const value: Vector2D)
def sprite_set_velocity(s, value):
Sprite Set X
Sets the X position of the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new x location.
- Signatures
-
void sprite_set_x(sprite s, float value)
public void Sprite.X { set } public static void SplashKit.SpriteSetX(Sprite s, float value);
procedure SpriteSetX(s: Sprite; value: Single)
def sprite_set_x(s, value):
Sprite Set Y
Sets the Y position of the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Value Float
The new sprite y.
- Signatures
-
void sprite_set_y(sprite s, float value)
public void Sprite.Y { set } public static void SplashKit.SpriteSetY(Sprite s, float value);
procedure SpriteSetY(s: Sprite; value: Single)
def sprite_set_y(s, value):
Sprite Show Layer
Sprite Show Layer
Show the specified layer of the sprite.
- Return Type
-
Integer
The index of the layer shown, or -1 if no layer found.
- Parameters
-
Name Type Description S The sprite to show the layer of.
Name String
The layer to show.
- Signatures
-
int sprite_show_layer(sprite s, const string &name)
public int Sprite.SpriteShowLayer(string name); public static int SplashKit.SpriteShowLayer(Sprite s, string name);
function SpriteShowLayer(s: Sprite; const name: String): Integer
def sprite_show_layer_named(s, name):
Sprite Show Layer
Show the specified layer of the sprite.
- Return Type
-
Integer
The index of the layer shown, or -1 if no layer found.
- Parameters
-
Name Type Description S The sprite to show the layer of.
Id Integer
The index to show.
- Signatures
-
int sprite_show_layer(sprite s, int id)
public int Sprite.SpriteShowLayer(int id); public static int SplashKit.SpriteShowLayer(Sprite s, int id);
function SpriteShowLayer(s: Sprite; id: Integer): Integer
def sprite_show_layer(s, id):
Sprite Speed
Returns the current speed (distance travelled per update) of the sprite.
- Return Type
-
Float
The speed of the sprite (pixels per update).
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_speed(sprite s)
public float Sprite.Speed { get } public static float SplashKit.SpriteSpeed(Sprite s);
function SpriteSpeed(s: Sprite): Single
def sprite_speed(s):
Sprite Start Animation
Sprite Start Animation
Start playing an animation from the sprite's animation template. This will play a sound effect if the first cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to start the animation of.
Named String
The name of the animation to start from the animation script.
- Signatures
-
void sprite_start_animation(sprite s, const string &named)
public void Sprite.SpriteStartAnimation(string named); public static void SplashKit.SpriteStartAnimation(Sprite s, string named);
procedure SpriteStartAnimation(s: Sprite; const named: String)
def sprite_start_animation_named(s, named):
Sprite Start Animation
Start playing an animation from the sprite's animation template. The with_sound parameter determines whether to play a sound effect if the first cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to start the animation of.
Named String
The name of the animation to start from the animation script.
With Sound Boolean
If false, the animation will not play associated sound effects when started.
- Signatures
-
void sprite_start_animation(sprite s, const string &named, bool with_sound)
public void Sprite.SpriteStartAnimation(string named, bool withSound); public static void SplashKit.SpriteStartAnimation(Sprite s, string named, bool withSound);
procedure SpriteStartAnimation(s: Sprite; const named: String; withSound: Boolean)
def sprite_start_animation_named_with_sound(s, named, with_sound):
Sprite Start Animation
Start playing an animation from the sprite's animation template. This will play a sound effect if the first cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to start the animation of.
Idx Integer
The index of the animation to start from the animation script.
- Signatures
-
void sprite_start_animation(sprite s, int idx)
public void Sprite.SpriteStartAnimation(int idx); public static void SplashKit.SpriteStartAnimation(Sprite s, int idx);
procedure SpriteStartAnimation(s: Sprite; idx: Integer)
def sprite_start_animation(s, idx):
Sprite Start Animation
Start playing an animation from the sprite's animation template. The with_sound parameter determines whether to play a sound effect if the first cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to start the animation of.
Idx Integer
The index of the animation to start from the animation script.
With Sound Boolean
If false, the animation will not play associated sound effects when started.
- Signatures
-
void sprite_start_animation(sprite s, int idx, bool with_sound)
public void Sprite.SpriteStartAnimation(int idx, bool withSound); public static void SplashKit.SpriteStartAnimation(Sprite s, int idx, bool withSound);
procedure SpriteStartAnimation(s: Sprite; idx: Integer; withSound: Boolean)
def sprite_start_animation_with_sound(s, idx, with_sound):
Sprite Stop Calling On Event
Removes an event handler from the sprite, stopping events from this sprite calling the indicated method.
- Parameters
-
Name Type Description S The sprite to remove the handler from
Handler The function to remove from this sprites handlers
- Signatures
-
void sprite_stop_calling_on_event(sprite s, sprite_event_handler *handler)
public void Sprite.SpriteStopCallingOnEvent(SpriteEventHandler handler); public static void SplashKit.SpriteStopCallingOnEvent(Sprite s, SpriteEventHandler handler);
procedure SpriteStopCallingOnEvent(s: Sprite; handler: SpriteEventHandler)
def sprite_stop_calling_on_event(s, handler):
Sprite Toggle Layer Visible
Sprite Toggle Layer Visible
Toggle the visibility of the specified layer of the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Name String
The name of the layer to toggle.
- Signatures
-
void sprite_toggle_layer_visible(sprite s, const string &name)
public void Sprite.SpriteToggleLayerVisible(string name); public static void SplashKit.SpriteToggleLayerVisible(Sprite s, string name);
procedure SpriteToggleLayerVisible(s: Sprite; const name: String)
def sprite_toggle_layer_visible_named(s, name):
Sprite Toggle Layer Visible
Toggle the visibility of the specified layer of the sprite.
- Parameters
-
Name Type Description S The sprite to change.
Id Integer
The index of the layer to toggle.
- Signatures
-
void sprite_toggle_layer_visible(sprite s, int id)
public void Sprite.SpriteToggleLayerVisible(int id); public static void SplashKit.SpriteToggleLayerVisible(Sprite s, int id);
procedure SpriteToggleLayerVisible(s: Sprite; id: Integer)
def sprite_toggle_layer_visible(s, id):
Sprite Value
Returns the indicated value of the sprite
- Return Type
-
Float
The value from the sprite's data store.
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the value to fetch.
- Signatures
-
float sprite_value(sprite s, const string &name)
public float Sprite.SpriteValue(string name); public static float SplashKit.SpriteValue(Sprite s, string name);
function SpriteValue(s: Sprite; const name: String): Single
def sprite_value(s, name):
Sprite Value Count
Returns the number of sprite's values.
- Return Type
-
Integer
The number of values stored in the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
int sprite_value_count(sprite s)
public int Sprite.ValueCount { get } public static int SplashKit.SpriteValueCount(Sprite s);
function SpriteValueCount(s: Sprite): Integer
def sprite_value_count(s):
Sprite Velocity
Returns the current velocity of the sprite. When the sprite is updated
(see Update Sprite
) this vector_2d is used to move the sprite.
- Return Type
-
The sprite's velocity.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
vector_2d sprite_velocity(sprite s)
public Vector2D Sprite.Velocity { get } public static Vector2D SplashKit.SpriteVelocity(Sprite s);
function SpriteVelocity(s: Sprite): Vector2D
def sprite_velocity(s):
Sprite Visible Index Of Layer
Sprite Visible Index Of Layer
Returns the index (z-order) of the sprite's layer.
- Return Type
-
Integer
The z index of the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Name String
The name of the layer to get the z index of.
- Signatures
-
int sprite_visible_index_of_layer(sprite s, const string &name)
public int Sprite.SpriteVisibleIndexOfLayer(string name); public static int SplashKit.SpriteVisibleIndexOfLayer(Sprite s, string name);
function SpriteVisibleIndexOfLayer(s: Sprite; const name: String): Integer
def sprite_visible_index_of_layer_named(s, name):
Sprite Visible Index Of Layer
Returns the index (z-order) of the sprite's layer.
- Return Type
-
Integer
The z index of the sprite's layer
- Parameters
-
Name Type Description S The sprite to get the details from.
Id Integer
The index of the layer to get the z index of.
- Signatures
-
int sprite_visible_index_of_layer(sprite s, int id)
public int Sprite.SpriteVisibleIndexOfLayer(int id); public static int SplashKit.SpriteVisibleIndexOfLayer(Sprite s, int id);
function SpriteVisibleIndexOfLayer(s: Sprite; id: Integer): Integer
def sprite_visible_index_of_layer(s, id):
Sprite Visible Layer
Returns the index of the n'th (idx parameter) visible layer.
- Return Type
-
Integer
The layer index of the selected visible layer.
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the visible layer to fetch.
- Signatures
-
int sprite_visible_layer(sprite s, int idx)
public int Sprite.SpriteVisibleLayer(int idx); public static int SplashKit.SpriteVisibleLayer(Sprite s, int idx);
function SpriteVisibleLayer(s: Sprite; idx: Integer): Integer
def sprite_visible_layer(s, idx):
Sprite Visible Layer Count
Returns the number of layers that are currently visible for the sprite.
- Return Type
-
Integer
The number of visible layers for the sprite.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
int sprite_visible_layer_count(sprite s)
public int Sprite.VisibleLayerCount { get } public static int SplashKit.SpriteVisibleLayerCount(Sprite s);
function SpriteVisibleLayerCount(s: Sprite): Integer
def sprite_visible_layer_count(s):
Sprite Visible Layer Id
Returns the id of the layer at index Idx
that is currently visible.
Index 0 is the background, with larger indexes moving toward the foreground.
This returns -1 if there are no visible layers.
- Return Type
-
Integer
The layer index of the visible layer.
- Parameters
-
Name Type Description S The sprite to get the details from.
Idx Integer
The index of the visible layer.
- Signatures
-
int sprite_visible_layer_id(sprite s, int idx)
public int Sprite.SpriteVisibleLayerId(int idx); public static int SplashKit.SpriteVisibleLayerId(Sprite s, int idx);
function SpriteVisibleLayerId(s: Sprite; idx: Integer): Integer
def sprite_visible_layer_id(s, idx):
Sprite Width
The current Width of the sprite (aligned to the X axis).
- Return Type
-
Integer
The width of the sprite's layer in pixels.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
int sprite_width(sprite s)
public int Sprite.Width { get } public static int SplashKit.SpriteWidth(Sprite s);
function SpriteWidth(s: Sprite): Integer
def sprite_width(s):
Sprite X
Returns the X position of the sprite.
- Return Type
-
Float
The x location of the sprite
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_x(sprite s)
public float Sprite.X { get } public static float SplashKit.SpriteX(Sprite s);
function SpriteX(s: Sprite): Single
def sprite_x(s):
Sprite Y
Returns the Y position of the sprite.
- Return Type
-
Float
The sprite's y location.
- Parameters
-
Name Type Description S The sprite to get the details from.
- Signatures
-
float sprite_y(sprite s)
public float Sprite.Y { get } public static float SplashKit.SpriteY(Sprite s);
function SpriteY(s: Sprite): Single
def sprite_y(s):
Stop Calling On Sprite Event
Removes an global event handler, stopping events calling the indicated void.
- Parameters
-
Name Type Description Handler The function to remove from the list of sprite event handlers.
- Signatures
-
void stop_calling_on_sprite_event(sprite_event_handler *handler)
public static void Sprite.StopCallingOnSpriteEvent(SpriteEventHandler handler); public static void SplashKit.StopCallingOnSpriteEvent(SpriteEventHandler handler);
procedure StopCallingOnSpriteEvent(handler: SpriteEventHandler)
def stop_calling_on_sprite_event(handler):
Update All Sprites
Update All Sprites
Update all of the sprites in the current sprite pack.
- Signatures
-
void update_all_sprites()
public static void Sprite.UpdateAllSprites(); public static void SplashKit.UpdateAllSprites();
procedure UpdateAllSprites()
def update_all_sprites():
Update All Sprites
Update all of the sprites in the current sprite pack, passing in a percentage value to indicate the percentage to update.
- Parameters
-
Name Type Description Pct Float
The percentage of the update to apply.
- Signatures
-
void update_all_sprites(float pct)
public static void Sprite.UpdateAllSprites(float pct); public static void SplashKit.UpdateAllSprites(float pct);
procedure UpdateAllSprites(pct: Single)
def update_all_sprites_percent(pct):
Update Sprite
Update Sprite
Update the position and animation details of the sprite. This will play a sound effect if the new cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to update.
- Signatures
-
void update_sprite(sprite s)
public void Sprite.UpdateSprite(); public static void SplashKit.UpdateSprite(Sprite s);
procedure UpdateSprite(s: Sprite)
def update_sprite(s):
Update Sprite
Update the position and animation details of the sprite. This will play a sound effect if the new cell of the animation has a sound and with_sound is true.
- Parameters
-
Name Type Description S The sprite to update
With Sound Boolean
If false, animations will not play associated sound effects when updated.
- Signatures
-
void update_sprite(sprite s, bool with_sound)
public void Sprite.UpdateSprite(bool withSound); public static void SplashKit.UpdateSprite(Sprite s, bool withSound);
procedure UpdateSprite(s: Sprite; withSound: Boolean)
def update_sprite_with_sound(s, with_sound):
Update Sprite
Update the position and animation details of the sprite by a given percentage of a single unit of movement/animation. This will play a sound effect if the new cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to update.
Pct Float
The percent to update.
- Signatures
-
void update_sprite(sprite s, float pct)
public void Sprite.UpdateSprite(float pct); public static void SplashKit.UpdateSprite(Sprite s, float pct);
procedure UpdateSprite(s: Sprite; pct: Single)
def update_sprite_percent(s, pct):
Update Sprite
Update the position and animation details of the sprite by a given percentage of a single unit of movement/animation. This will play a sound effect if the new cell of the animation has a sound and with_sound is true.
- Parameters
-
Name Type Description S The sprite to update.
Pct Float
The percent to update.
With Sound Boolean
If false, animations will not play associated sound effects when updated.
- Signatures
-
void update_sprite(sprite s, float pct, bool with_sound)
public void Sprite.UpdateSprite(float pct, bool withSound); public static void SplashKit.UpdateSprite(Sprite s, float pct, bool withSound);
procedure UpdateSprite(s: Sprite; pct: Single; withSound: Boolean)
def update_sprite_percent_with_sound(s, pct, with_sound):
Update Sprite Animation
Update Sprite Animation
Updates the animation details of the sprite. This will play a sound effect if the new cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to update.
- Signatures
-
void update_sprite_animation(sprite s)
public void Sprite.UpdateSpriteAnimation(); public static void SplashKit.UpdateSpriteAnimation(Sprite s);
procedure UpdateSpriteAnimation(s: Sprite)
def update_sprite_animation(s):
Update Sprite Animation
Update the animation details of the sprite. This will play a sound effect if the new cell of the animation has a sound and with_sound is true.
- Parameters
-
Name Type Description S The sprite to update.
With Sound Boolean
If false, animations will not play associated sound effects when updated.
- Signatures
-
void update_sprite_animation(sprite s, bool with_sound)
public void Sprite.UpdateSpriteAnimation(bool withSound); public static void SplashKit.UpdateSpriteAnimation(Sprite s, bool withSound);
procedure UpdateSpriteAnimation(s: Sprite; withSound: Boolean)
def update_sprite_animation_with_sound(s, with_sound):
Update Sprite Animation
Update the animation details of the sprite by a given percentage of a single unit of movement/animation. This will play a sound effect if the new cell of the animation has a sound.
- Parameters
-
Name Type Description S The sprite to update.
Pct Float
The percent to update.
- Signatures
-
void update_sprite_animation(sprite s, float pct)
public void Sprite.UpdateSpriteAnimation(float pct); public static void SplashKit.UpdateSpriteAnimation(Sprite s, float pct);
procedure UpdateSpriteAnimation(s: Sprite; pct: Single)
def update_sprite_animation_percent(s, pct):
Update Sprite Animation
Update the position and animation details of the sprite by a given percentage of a single unit of movement/animation. This will play a sound effect if the new cell of the animation has a sound and with_sound is true.
- Parameters
-
Name Type Description S The sprite to update.
Pct Float
The percent to update.
With Sound Boolean
If false, animations will not play associated sound effects when updated.
- Signatures
-
void update_sprite_animation(sprite s, float pct, bool with_sound)
public void Sprite.UpdateSpriteAnimation(float pct, bool withSound); public static void SplashKit.UpdateSpriteAnimation(Sprite s, float pct, bool withSound);
procedure UpdateSpriteAnimation(s: Sprite; pct: Single; withSound: Boolean)
def update_sprite_animation_percent_with_sound(s, pct, with_sound):
Vector From Center Sprite To Point
Returns a Vector 2D
that is the difference in location from the center of
the sprite S
to the point Pt
.
- Return Type
-
A vector pointing from the sprite to the point.
- Parameters
-
Name Type Description S The sprite that is at the start of the vector.
Pt The point that is at the end of the vector.
- Signatures
-
vector_2d vector_from_center_sprite_to_point(sprite s, const point_2d &pt)
public Vector2D Sprite.VectorFromCenterSpriteToPoint(Point2D pt); public static Vector2D SplashKit.VectorFromCenterSpriteToPoint(Sprite s, Point2D pt);
function VectorFromCenterSpriteToPoint(s: Sprite; const pt: Point2D): Vector2D
def vector_from_center_sprite_to_point_point(s, pt):
Vector From To
Returns a Vector 2D
that is the difference in the position of two sprites
(S1
and S2
).
- Return Type
-
A vector that points from s1 to s2.
- Parameters
-
Name Type Description S1 The sprite that is at the start of the vector.
S2 The sprite that is at the end of the vector.
- Signatures
-
vector_2d vector_from_to(sprite s1, sprite s2)
public Vector2D Sprite.VectorFromTo(Sprite s2); public static Vector2D SplashKit.VectorFromTo(Sprite s1, Sprite s2);
function VectorFromTo(s1: Sprite; s2: Sprite): Vector2D
def vector_from_to(s1, s2):
Types
Collision Test Kind
This enumeration can be used to set the kind of collisions a sprite will check for.
- Constants
-
Name Description Pixel Collisions The sprite will check for collisions with its collision bitmap.
Aabb Collisions The sprite will check for collisions with a bounding box around the sprite.
Sprite
Sprites combine an image, with position and animation details. You can
create a sprite using Create Sprite
, draw it with Draw Sprite
, move it
using the Sprite Velocity
with Update Sprite
, and animate it using an
Animation Script
.
Sprite Event Handler
The spriteeventhandler function pointer is used when you want to register to receive events from a Sprite.
Sprite Event Kind
This enumeration contains a list of all of the different kinds of events that a Sprite can raise. When the event is raised the assocated spriteeventkind value passed to the event handler to indicate the kind of event that has occurred.
- Constants
-
Name Description Sprite Arrived Event The sprite has arrived at the end of a move
Sprite Animation Ended Event The Sprite's animation has ended.
Sprite Touched Event The Sprite was touched
Sprite Clicked Event The Sprite was touched
Sprite Float Function
The sprite single function is used with sprite packs to provide a procedure to be called for each of the Sprites in the sprite pack, where a float value is required.
Sprite Function
sprite_function is used with SpritePacks to provide a procedure to be called for each of the Sprites in the SpritePack.