Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite overrides another sprite (isometric tiles/map)  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

sadin97

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Sprite overrides another sprite (isometric tiles/map)
« on: September 05, 2017, 09:41:58 pm »
I managed to make isometric map but I have problem on overriding sprites while selecting the certain tile.

I made isometric map from this 1 tile:



I made something like this:



Which is the problem.

When I select one of blue tiles (and I clicked in area where is grey rectangular) program (mouse) detects all of tiles in that area.

Now, the question is how will I change this grid perspective and fix this problem.
I found some similiar questions on forum but couldn't fix this problem.



How to change "grid" or what it is called from yellow to green. So when I click desirable tile that and only that tile would be selected.

Thanks and sorry for my bad English.


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Sprite overrides another sprite (isometric tiles/map)
« Reply #1 on: September 05, 2017, 09:47:36 pm »
You'll have to use math for isometric perspectives. It's quite a general problem, so there are many resources out there. SFML doesn't provide anything that will help you with that problem.

Here's what I got as first result when googling for "isometric math": http://clintbellanger.net/articles/isometric_math/
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/