SFML community forums

Help => Window => Topic started by: LightCancel on September 25, 2014, 09:44:13 pm

Title: Does SFML have any innate functions for drawing relative to the window?
Post by: LightCancel on September 25, 2014, 09:44:13 pm
It's easy enough to draw to the world, so to speak, but for UI elements is there a way to call draw so that it's drawn relative to your screen so that when you move the view, the UI elements stay in place because they darw to the screen, not the world.
Title: Re: Does SFML have any innate functions for drawing relative to the window?
Post by: Laurent on September 25, 2014, 09:50:41 pm
Use another (static) view for your GUI, as explained in the tutorial for example.
Title: Re: Does SFML have any innate functions for drawing relative to the window?
Post by: LightCancel on September 25, 2014, 10:11:42 pm
Use another (static) view for your GUI, as explained in the tutorial for example.

Are you referring to this tutorial? http://sfml-dev.org/tutorials/2.1/graphics-vertex-array.php
Title: Re: Does SFML have any innate functions for drawing relative to the window?
Post by: Hapax on September 25, 2014, 10:26:49 pm
Try this tutorial (http://sfml-dev.org/tutorials/2.1/graphics-view.php). You can use more than one view. Use a different one for your UI and switch between them when drawing.
Title: Re: Does SFML have any innate functions for drawing relative to the window?
Post by: LightCancel on September 25, 2014, 11:56:34 pm
Thanks to everyone who responded! I now have the desired results!