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

Author Topic: Setting up a particular position for an object in Fullscreen mode  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

snowf1ake

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
I have some experience with SFML, but now i decided to make a fullscreen game. After some headache with finding a proper resolution for each PC, i stumbled upon a problem with a specific task. Let's imagine i need to place an object to x,y = 1000,1300. What do i do if the player's monitor does not have this position?(resolution is smaller). Is there any way to put objects to particular locations, as in
VideoMode(800,600)
i would use
setPosition(700,300)
, or will i have to use math to calculate specific locations in percentages of the screen? For example, some web developers might put a header for the 20% of the page, so it would work on all computers.

Thanks in advance.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Setting up a particular position for an object in Fullscreen mode
« Reply #1 on: December 19, 2017, 06:35:48 am »
You can use a fixed size view (sf::View), that will allow you to use the same coordinate system regardless of the size of the window. Then everything will be scaled to fit the window -- if that's what you want.
Laurent Gomila - SFML developer

snowf1ake

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Setting up a particular position for an object in Fullscreen mode
« Reply #2 on: December 19, 2017, 06:42:28 am »
Seems like i will need to research sf::View. Thanks for a quick response, i will try to figure it out.

 

anything