Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | apb1963 | |
Old Version | Published before Godot 3 was released. |
I created a tile map with images of a brick wall 50px square. I painted a rectangle using this map. I want to get the dimensions of said rectangle so I can restrict the movement of my sprite to either inside or outside the rectangle/room.
Currently I’m doing this: if (cur_pos.x < 740 ), but I don’t want to hard code numeric literals.
I tried creating a wall object that was just barely the size of the inner rectangle but it has no texture so I can’t get its size and a tilemap isn’t a node so I can’t get its size either.
I don’t know how to go from tilemap to texture. Or whatever the correct way of doing this might be. Thank you in advance!
- APB
P.S. As I finished typing this it occurred to me that I could simply add a random texture to the wall object, but I’m not sure that’s going to help any.
apb1963 | 2017-03-21 01:50
OK, lets try this a different way… here’s the link, a few slightly different ways just in case…
http://picpaste.com/wall_size_2017-03-20_18-21-58-E3KwqsEt.png
http://picpaste.com/wall_size_2017-03-20_18-21-58-E3KwqsEt.png
“http://picpaste.com/wall_size_2017-03-20_18-21-58-E3KwqsEt.png”
apb1963 | 2017-03-21 01:53