Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FireSide_01 |
I looked into a scene file, and it looks like it’s stored in a PoolIntArray. But I can’t seem to figure out what these numbers mean.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FireSide_01 |
I looked into a scene file, and it looks like it’s stored in a PoolIntArray. But I can’t seem to figure out what these numbers mean.
Reply From: | njamster |
There are three numbers added to the PoolIntArray for each tile you add:
What about the flip flags? Those must be in there too? flip_x, flip_y, and transpose?
set_cell ( int x, int y, int tile, bool flip_x=false, bool flip_y=false, bool transpose=false, Vector2 autotile_coord=Vector2( 0, 0 ) )
rakkarage | 2020-09-23 17:18
Yes. They are encoded by offsetting the id of the tile (the second value):
flip_x: add 2^29 = 536870912
flip_y: add 2^30 = 1073741824
flip_x AND flip_y: add 2^29 + 2^30 = 1610612737
rotate_left: add 2^30 = 1073741824 and invert the sign
rotate_right: add 2^29 + 2^30 = 1610612737 and invert the sign
njamster | 2020-09-25 12:58