SFML community forums

General => General discussions => Topic started by: guiguithebest on July 20, 2011, 08:46:22 pm

Title: SFML GUI
Post by: guiguithebest 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?
Title: SFML GUI
Post by: Nexus 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.