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

Author Topic: Does SFML have any innate functions for drawing relative to the window?  (Read 2714 times)

0 Members and 1 Guest are viewing this topic.

LightCancel

  • Newbie
  • *
  • Posts: 6
    • View Profile
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Does SFML have any innate functions for drawing relative to the window?
« Reply #1 on: September 25, 2014, 09:50:41 pm »
Use another (static) view for your GUI, as explained in the tutorial for example.
Laurent Gomila - SFML developer

LightCancel

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Does SFML have any innate functions for drawing relative to the window?
« Reply #2 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

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Does SFML have any innate functions for drawing relative to the window?
« Reply #3 on: September 25, 2014, 10:26:49 pm »
Try this tutorial. You can use more than one view. Use a different one for your UI and switch between them when drawing.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

LightCancel

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Does SFML have any innate functions for drawing relative to the window?
« Reply #4 on: September 25, 2014, 11:56:34 pm »
Thanks to everyone who responded! I now have the desired results!

 

anything