You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to take the tile data from a tilemap and use it to make an image file to use as a map of sorts.
I had to go to the source code of the game to see what each value in the array was.
I think this would be an easy addition to the TileMapLayer documentation.
It would also make the set_tile_map_data_from_array(value) function more useful.
(Values below for anyone interested [or so you don't have to look up the source code in case this gets implemented])
[indexes]: function
[0,1]: versioning information
[2,3]: the X position on the map
[4,5]: the Y position on the map
[6,7]: source texture ID
[8,9]: X coordinate on the texture atlas
[10,11]: Y coordinate on the texture atlas
[12,13]: Tile variation number
(The data is stored as encode_uint16 meaning they take up 2 bytes on the list [Just stick the bits next to each other to get a number])
(Negatives are stored as 2's complement [Just write the positive number in bits, flip the bits, and add 1 to get a negative number])
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to take the tile data from a tilemap and use it to make an image file to use as a map of sorts.
I had to go to the source code of the game to see what each value in the array was.
I think this would be an easy addition to the TileMapLayer documentation.
It would also make the set_tile_map_data_from_array(value) function more useful.
(Values below for anyone interested [or so you don't have to look up the source code in case this gets implemented])
[indexes]: function
[0,1]: versioning information
[2,3]: the X position on the map
[4,5]: the Y position on the map
[6,7]: source texture ID
[8,9]: X coordinate on the texture atlas
[10,11]: Y coordinate on the texture atlas
[12,13]: Tile variation number
(The data is stored as encode_uint16 meaning they take up 2 bytes on the list [Just stick the bits next to each other to get a number])
(Negatives are stored as 2's complement [Just write the positive number in bits, flip the bits, and add 1 to get a negative number])
Beta Was this translation helpful? Give feedback.
All reactions