background_xscale

This variable controls the scaling along the x axis of the given background number.

Syntax:

background_xscale[0...7]


Returns: Real


Description

This variable returns the x axis scale of the image that has been used for the background_index of the same array value. The default value is 1, but this can be set to other values to stretch the background image.



NOTE: You cannot scale backgrounds in any way when using the HTML5 target module without having first enabled WebGL (in the Global Game Settings).


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_yscale
© Copyright YoYo Games Ltd. 2018 All Rights Reserved