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

Author Topic: SFML GUI  (Read 2194 times)

0 Members and 1 Guest are viewing this topic.

guiguithebest

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML GUI
« on: July 20, 2011, 08:46:22 pm »
Hey everyone, I'm trying to make a GUI with sfml, but I have a problem. When I put the mouse on the sprite I use as button, it should turn green. But the sprite's position is only one point. So how can I get the whole sprite's position? Is there a function for this?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
SFML GUI
« Reply #1 on: July 20, 2011, 09:08:25 pm »
You mean the rectangular bounds? You can compute them with GetPosition() and GetSize(). In case you modify the origin of the sprite, you also need to take GetOrigin() into account.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything