Module ncine.base_sprite

The table containing base sprite related functions.

Inherits from ncine.drawable_node.

Functions

ncine.base_sprite.set_size (sprite, width, height) Sets the sprite size
ncine.base_sprite.get_texture (sprite) Returns the texture object
ncine.base_sprite.set_texture (sprite, texture) Sets the texture object
ncine.base_sprite.reset_texture (sprite) Triggers a texture update without setting a new texture
ncine.base_sprite.get_texrect (sprite) Returns the texture source rectangle for blitting
ncine.base_sprite.set_texrect (sprite, rect) Sets the texture source rectangle for blitting
ncine.base_sprite.is_flipped_x (sprite) Returns true if the sprite texture is horizontally flipped
ncine.base_sprite.set_flipped_x (sprite, flipped_x) Flips the texture rect horizontally
ncine.base_sprite.is_flipped_y (sprite) Returns true if the sprite texture is vertically flipped
ncine.base_sprite.set_flipped_y (sprite, flipped_y) Flips the texture rect vertically

Tables

basespriteObj The light user data of a base sprite object.


Functions

ncine.base_sprite.set_size (sprite, width, height)
Sets the sprite size

Parameters:

ncine.base_sprite.get_texture (sprite)
Returns the texture object

Parameters:

Returns:

    ncine.texture.textureObj or nil
ncine.base_sprite.set_texture (sprite, texture)
Sets the texture object

Parameters:

ncine.base_sprite.reset_texture (sprite)
Triggers a texture update without setting a new texture

Parameters:

ncine.base_sprite.get_texrect (sprite)
Returns the texture source rectangle for blitting

Parameters:

Returns:

    ncine.rect
ncine.base_sprite.set_texrect (sprite, rect)
Sets the texture source rectangle for blitting

Parameters:

ncine.base_sprite.is_flipped_x (sprite)
Returns true if the sprite texture is horizontally flipped

Parameters:

Returns:

    boolean
ncine.base_sprite.set_flipped_x (sprite, flipped_x)
Flips the texture rect horizontally

Parameters:

ncine.base_sprite.is_flipped_y (sprite)
Returns true if the sprite texture is vertically flipped

Parameters:

Returns:

    boolean
ncine.base_sprite.set_flipped_y (sprite, flipped_y)
Flips the texture rect vertically

Parameters:

Tables

basespriteObj
The light user data of a base sprite object.

Inherits from ncine.drawable_node.drawablenodeObj.

generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56