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

Author Topic: how scale window  (Read 3980 times)

0 Members and 1 Guest are viewing this topic.

FelperOneS

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
how scale window
« on: November 14, 2020, 05:29:15 am »
I want my window to be 320x240 full screen resolution.
When running the application, the game seems very small.
I want the game to fill the entire monitor screen without changing the resolution, just scaling.
no black bars.
how to do it? thanks

G.

  • Hero Member
  • *****
  • Posts: 1590
    • View Profile
Re: how scale window
« Reply #1 on: November 14, 2020, 08:16:32 am »
Use an sf::View of size 320*240, its content will be stretched to whatever your window size is.
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1View.php
https://www.sfml-dev.org/tutorials/2.5/graphics-view.php

FelperOneS

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: how scale window
« Reply #2 on: November 15, 2020, 12:50:32 am »
i dont understand how implement this in the code

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: how scale window
« Reply #3 on: November 17, 2020, 01:20:36 pm »
As part of the tutorial linked above, see https://www.sfml-dev.org/tutorials/2.5/graphics-view.php#defining-what-the-view-views

You will likely want a view that starts at (0, 0) with a size of 320x240, right?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything