tile_layer_shift(depth, x, y);
Argument | Description |
---|---|
depth | The depth of tiles which is to be shifted. |
x | The amount to shift over the x-axis. |
y | The amount to shift over the y-axis |
Returns: N/A
This function can be used to move a whole tile layer. It works by shifting the layer by the specified amount over each axis, with a positive x shift moving right, a negative x shift moving left, a positive
y shift moving down and a negative y shift moving up. Please note that the values move the tile layer relative to its position and are not absolute, so setting the (x,y) values to, for example,
(32,32) will move the tile layer down and right by 32 pixels, it will not position it at (32,32) in the room.
tile_layer_shift(-1000, obj_Player.hspeed, 0);
The above code will shift the tile layer at depth -1000 by the same amount as the horizontal speed of the instance of object "obj_Player".