texture_get_width

Gets the width of a given texture asset.

Syntax:

texture_get_width(tex);


Argument Description
tex The texture page asset pointer to use


Returns: Real


Description

Returns the width of the texture with the given id, which is always a value within the range 0 - 1. This can then be used when mapping textures to models or primitives.


Example:

tex_w = texture_get_width(sprite_get_texture(spr_Model_tex, 0));

The above code will get the width of the texture taken from a sprite asset.


Back: Textures
Next: texture_get_texel_height
© Copyright YoYo Games Ltd. 2018 All Rights Reserved