set_bg_data

Sets the values of a custom stage’s specific background layer.

You can set the following indexes:

Note that this only works on custom stages. Using this on a default stage will do nothing.

ArgumentTypeDescription
layer:realThe layer to change.Layers 1-6 are background, Layer 7 is ground level, and layers 8-9 are the foreground.
data:realThe data index to set. Can be one of the indexes listed above.
value:realThe value the data will be set to.

Example, called from a stage’s update.gml:
//This will cause the first background layer to sway up and down by 10 pixels over time.
set_bg_data(1, BG_LAYER_AUTOSCROLL_Y, sin(get_gameplay_time()) * 10 );