background_get_uvs

Returns the texture coordinates of the background within the texture page as an array.

Syntax:

background_get_uvs(back);


Argument Description
back The index of the background to use.


Returns: Array


Description

This function returns an array with the UV coordinates for the texture on the texture page, filling in the array with the following values: [0] = left, [1] = top, [2] = right and [3] = bottom. This value can then be used in other draw functions, particularly in general 3D and some of the 2D primitive functions, as well as the Shader functions.


Example:

var tex = background_get_uvs(back);
tex_left = tex[0];
tex_top = tex[1];
tex_right = tex[2];
tex_bottom = tex[3];

The above code will store the UV coordinates for the given background in a local array and then assign the values to instance variables.


Back: Backgrounds
Next: background_get_name
© Copyright YoYo Games Ltd. 2018 All Rights Reserved