background_width

Returns the width of the background with the given index in the current room.

Syntax:

background_width[0...7]


Returns: Real


Description

This read only variable returns the width of the image that has been used for the background_index of the same array value. Should you need to make a background fit a specific width, you should change the background_xscale.


Example:

if room_width != background_width[0]
   {
   background_xscale[0] = 1 * (room_width / background_width[0]);
   }

The above code will scale background to fit the width of the room.


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