background_get_width

Finds the width of a background.

Syntax:

background_get_width(index);


Argument Description
index The index of the background to find the width of.


Returns: Real


Description

With this function you can find the width of the base background asset, with no transforms, in pixels.


Example:

if background_width[0] != background_get_width(background_index[0])
   {
   background_width[0] = background_get_width(background_index[0]);
   }

The above code checks the width of the background as it is in the current room and if there is a difference between that and the original base background, it resets the width.


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