Godot Version
4.6
Question
I have looked and don’t see a way. Is there a way to get a TileMapLayer’s Width and Height easily?
I thought there would be exposed properties, but I didn’t see anything obvious.
I can slap a node over it and size it to the same size, and use that instead. It would work but seems a little hokey.
Apologies if this has already been answered somewhere.
Answered by @tomyy here:
Just a few thoughts:
don’t use TileMap in new games, it is deprecated. Use TileMapLayer exclusively
tiles: MineSweeper has a fixed, limited amount of different tiles: hidden, flagged, mine, triggered mine, zero to 8 adjacent mines are a total 13 different tiles
cells: what varies is the number of cells that the player sees:
easy: 9x9 = 81 cells, 10 mines
medium: 16x16 = 256 cells, 40 mines
hard: 16x30 = 480 cells, 99 mines
while it might be difficult to change the number of tiles at runtime…
As mentioned there you can use: get_used_rect
Wow thank you for that. I thought I must be nuts for not seeing that, but it appears my Intellisense in Rider is acting strange, because that method is missing. It’s not the only one. Need to look into what that’s about lol.
Maybe check and see if you accidentally turned on a Claude based autocomplete or something. That won’t work.
Personally I prefer the shipped gdscript editor.
Oh and if you do use gdscript, make sure you explicitly assign the type to your vars, otherwise no autocomplete.