background_vspeed

Variable that determines the vertical scrolling speed for a background.

Syntax:

background_vspeed[0...7];


Returns: Real


Description

By setting this variable array to a different value, you can set the speed at which GameMaker: Studio automatically scrolls a background for you along the vertical plane. A positive value will scroll from top to bottom, while a negative value will be bottom to top and 0 stops all scrolling. if you have also enabled vertical tiling, either through the room editor or by using the background_vtiled variable, then scrolling the background will make it loop infinitely.


Example:

if background_vtiled[0] = true
   {
   background_vspeed[0] = 2;
   }

The above code checks background0 to see if it is tiled vertically, and if it is it then sets the vertical scroll speed to 2.


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