[SOLVED] [EDIT] I found it by working through layer functions then got to
Hello,
In the simple example below, I wish to get a given backgrounds Y value programatically, so I can change the sprite when it's out the screen and move it up top. So far I have worked out how to change the sprite as shown below, but the closest i have come to obtaining the Y value is
Many thanks
layer_get_y
in the documentation, I can set it with layer_y
. Hello,
In the simple example below, I wish to get a given backgrounds Y value programatically, so I can change the sprite when it's out the screen and move it up top. So far I have worked out how to change the sprite as shown below, but the closest i have come to obtaining the Y value is
background_y
from the documentation, although it's confusing as an example it gives to modify a positionbackground_y[0] = view_yview[0]-50;
is hard to follow, i'm guessing this is depreciated as i can't get them to work they show up as blue and not system variables.
GML:
myBackgroundOneID = layer_background_get_id("secondBackground")
layer_background_sprite(myBackgroundOneID, bGrass);
Attachments
-
54.5 KB Views: 0
Last edited: