SFML community forums
Help => Graphics => Topic started by: Williamson on November 30, 2008, 01:00:42 pm
-
Hello!
My name is Williamson, and I am currently making an MMO using SFML.
However, I have encountered a difficulty, which is that I dont know how to display a Sprite on a View, or at least in a way which makes it appear to be on the View. (like the interface in Age of Empires, which contains buttons and stuff like that)
Is this possible?
Thank you for any answers!
Williamson
-
Just draw the sprite last so it's drawn on top.
Or are you looking for something else?
-
I don't really understand what you mean, but I will take a wild guess and say you're trying to draw immobile objects on top of a moving view/world.
Here is an example of how to draw relative to the GUI (assuming you have not edited App's default View):
App.SetView(View); // Draw relative to the world
App.Draw(Map); // Draw the map
App.SetView(App.GetDefaultView()); // Draw relative to the GUI
App.Draw(Interface); // Draw the GUI
-
I know what he means. He wants to draw sprites as GUI so that no matter how the view moves, the sprite's position on the screen doesn't change.
I think Wizzard's code does it.
-
Thanks!
Ill give it a try as soon as possible
Williamson
[EDIT:] Thanks Wizzard! It does exactly what I wanted now!