tile_info.type returning 0? - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: tile_info.type returning 0? (/showthread.php?tid=2298) |
tile_info.type returning 0? - RootBeerKing - 08-16-2023 Hello, I'm trying to get collision to work with the forest sample. I've added types to the tileset in Tiled, but when I go to get the tile type using TLN_GetLayerTile (LAYER_FOREGROUND, 11*16,12*16, &tile_info); the number I entered in the tile type in Tiled doesn't show up, I only get a 0 returned when I print it using std::cout << tile_info.type << std::endl; Is this a bug, or did I do something wrong? This is my tileset file: Code: <?xml version="1.0" encoding="UTF-8"?> RE: tile_info.type returning 0? - megamarc - 08-17-2023 Hi, I can't reproduce the issue. Using your modified tileset and writing the following queries: Code: TLN_TileInfo tile_info = {0}; Produces the expected output: Code: Tilengine v2.15.1 64-bit release built Apr 23 2023 19:27:20 RE: tile_info.type returning 0? - RootBeerKing - 08-18-2023 Must be an error in how I'm writing the print code in C++, once I switched to your C code for the print the error went away. Thank you so much |