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

Author Topic: Resizing window and scaling objects.  (Read 1770 times)

0 Members and 1 Guest are viewing this topic.

Wuwus1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Resizing window and scaling objects.
« on: January 13, 2018, 10:44:32 pm »
I started my own project a while ago and can't pass over one problem. I created my own top bar interface with action buttons, resizing and everything. While resizing the window everything i draw(in this window) is resizing too but i want everything to be its orginal size. For example the top bar height is 5/100 of the screen height that my app is displayed (for me it is 30px). If i resize the window the top bar is resizing too (for me it is 52px now). But if i print out the height of the top bar it's saying that the top bar height is 30px. How do i fix it. Do i need to change the view? Or scale everything?
I attach a video to make the whole problem clear because i know my english is not the best ;)
Link to yt: https://www.youtube.com/watch?v=3WinkG20Ueo&feature=youtu.be

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Resizing window and scaling objects.
« Reply #1 on: January 14, 2018, 12:45:53 am »
The official view tutorial has a dedicated section about this topic: https://www.sfml-dev.org/tutorials/2.4/graphics-view.php#showing-more-when-the-window-is-resized

Might be worth going through all the relevant tutorials if you haven't done so already. ;)

Sent from my Nexus 5X using Tapatalk

Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Wuwus1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Resizing window and scaling objects.
« Reply #2 on: January 14, 2018, 11:07:24 am »
Thank for the suggestion i will definitely go through those tutorials.  :)

 

anything