Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved]Tile id by screen x,y

Status
Not open for further replies.

arev

Sponsor

How would I check the id of a tile at specific screen coords? These coorrdinates would be taken from a sprite if that would help any. Any help greatly appreciated :)
 

arev

Sponsor

Thanks, I've just figured it out myself :D Such lame of me... :] I just had to transform the screen coordinates. Anyway, if someone would be interested in this, here's the complete code:
Code:
$game_map.terrain_tag(m.x/32+($game_map.display_x/4)/32,m.y/32+($game_map.display_y/4)/32)
m.x and m.y are object's screen coords.
 
This topic has been resolved. If arevulopapo or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top