🖼️texture
This type represents a texture object.
__call
Constructs an instance of this type.
Passing an invalid pointer, a or memory region that is smaller than the size will result in a crash.
Arguments
1. From file.
Name
Type
Description
path
string
Path to a valid texture file.
2. From memory.
Name
Type
Description
sz
int
Size of the texture file data.
3. From RGBA data.
Name
Type
Description
w
int
Width.
h
int
Height (row count).
p
int
Pitch (row width). This is the amount of bytes per row.
Returns
Type
Description
texture
Texture object.
Example
local tex = draw.texture('funny_meme.png');
is_animated
Type: bool
Set to true
if this is an instance of animated_texture
.
get_size
Returns size of this texture.
Arguments
None.
Returns
Type
Description
Texture dimensions.
Example
local sz = tex:get_size();
Last updated