Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
sprite detection by coordinates
Print
Pages: [
1
]
Author
Topic: sprite detection by coordinates (Read 1669 times)
0 Members and 2 Guests are viewing this topic.
Reiv
Newbie
Posts: 13
sprite detection by coordinates
«
on:
June 18, 2011, 08:35:15 pm »
Hi I couldn't figure how I can the application detect if eg. some mouse over some Sprite.
I have background sprite, character sprite and some npc sprite etc. I can get coordinates of every sprite by sf::sprite name.GetPosition(), but is there some other way around? Can I somehow get sf::sprite object by using coordinates.
For example I get mouse coordinates and I want to know if there is some sprite on this coordinates.
Thanks :oops:
Logged
OniLinkPlus
Hero Member
Posts: 500
sprite detection by coordinates
«
Reply #1 on:
June 18, 2011, 08:58:06 pm »
No, you can't do that without some special implementation. I suggest keeping a list of every sprite that exists somewhere, and when you want to find one at a certain position, go through the list looking for one that is at that position.
Logged
I use the latest build of SFML2
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
sprite detection by coordinates