This function returns the width of a single texel from the texture page of the image asset used.
A texel, or texture element is the fundamental unit of texture space used in computer graphics. Textures are represented by arrays of texels, just as pictures are represented by arrays of pixels.
texture_get_texel_width(tex);
Argument | Type | Description |
---|---|---|
tex | Texture | The texture page asset pointer to use |
var tex = sprite_get_texture(sprite_index, 0);
tex_w = texture_get_texel_width(tex);
tex_h = texture_get_texel_height(tex);
The above code will get the texel width and height of the texture taken from a sprite asset.