Module ncine.sprite
The table containing sprite related functions.
Inherits from ncine.base_sprite.
Functions
ncine.sprite.new (parent, texture, x, y) | Constructs a sprite object with a parent scene node, a texture, and position components. |
ncine.sprite.new (parent, texture, pos) | Constructs a sprite object with a parent scene node, a texture, and a position vector. |
ncine.sprite.clone (sprite) | Constructs a new sprite object as a clone of the specified one. |
ncine.sprite.delete (sprite) | Destroys a sprite object and releases its memory |
Tables
spriteObj | The light user data of a sprite object. |
Functions
- ncine.sprite.new (parent, texture, x, y)
-
Constructs a sprite object with a parent scene node, a texture, and position components.
Don’t forget to call ncine.sprite.delete when you are done with it!
Parameters:
- parent ncine.scenenode.scenenodeObj |nil The parent scenenode
- texture ncine.texture.textureObj or nil The texture object
- x number The X component of the position
- y number The Y component of the position
Returns:
-
spriteObj
A new sprite object
- ncine.sprite.new (parent, texture, pos)
-
Constructs a sprite object with a parent scene node, a texture, and a position vector.
Don’t forget to call ncine.sprite.delete when you are done with it!
Parameters:
- parent ncine.scenenode.scenenodeObj |nil The parent scenenode
- texture ncine.texture.textureObj or nil The texture object
- pos ncine.vec2 The position vector
Returns:
-
spriteObj
A new sprite object
- ncine.sprite.clone (sprite)
-
Constructs a new sprite object as a clone of the specified one.
Don’t forget to call ncine.sprite.delete when you are done with it!
Parameters:
- sprite spriteObj The sprite object to be cloned
Returns:
-
spriteObj
The cloned sprite object
- ncine.sprite.delete (sprite)
-
Destroys a sprite object and releases its memory
Parameters:
- sprite spriteObj The sprite object to be destroyed
Tables
- spriteObj
-
The light user data of a sprite object.
Inherits from ncine.base_sprite.basespriteObj.