Legacy GM Rotating tiles with code?

Fixer90

Member
Title says it all. Can tiles be rotated with code, even unconventionally?
Code:
var ground = tile_get_ids_at_depth(1000010);

for(var g = array_length_1d(ground), n = 0; n < g; n ++)
{
    tile_set_rotation_oh_wait_this_function_doesnt_exist_darn_it(ground[n], choose(0, 90, 180, 270));
}
NOTE: This is in the Room Start event in a persistent object.
 
Last edited:

jo-thijs

Member
Title says it all. Can tiles be rotated with code, even unconventionally?
Code:
var ground = tile_get_ids_at_depth(1000010);

for(var g = array_length_1d(ground), n = 0; n < g; n ++)
{
    tile_set_rotation_oh_wait_this_function_doesnt_exist_darn_it(ground[n], choose(0, 90, 180, 270));
}
NOTE: This is in the Room Start event in a persistent object.
In GM:S 1.4, this does not seem to be possible.
It is possible in GM:S 2 and you can also use your own tricks in GM:S 1.4.
You can create 4 backgrounds, all containing the same tiles at the same positions, but have them rotated.
You would then create a script that rotates tiles by changing the background index.
If you're very consistent with applying this technique to all your backgrounds, you can even make this script to be 1 line.
 
E

Edmanbosch

Guest
Title says it all. Can tiles be rotated with code, even unconventionally?
Code:
var ground = tile_get_ids_at_depth(1000010);

for(var g = array_length_1d(ground), n = 0; n < g; n ++)
{
    tile_set_rotation_oh_wait_this_function_doesnt_exist_darn_it(ground[n], choose(0, 90, 180, 270));
}
NOTE: This is in the Room Start event in a persistent object.
If you're using GMS2 tile_set_rotate could be what you're looking for.
 

Fixer90

Member
Luckily I already found a way to do it, but only to 0, 90, 180, and 270 degrees. Thanks for all the replies!
 
Top