Render frame resize issue
« on: 23 January 2014, 05:00:35 »
So I looked through the tutorials, forum, etc and didn't seem to find anything that answered this. I'm currently rendering my sfml window at 1280 x 720. When you press the fullscreen button I max out the resolution and update the render windows view, which works on everything except my tgui components.

They seem to scale and not resize, button events also no longer work for where they are currently located (mouse over works for their old locations. I was sending true into draw() so the view reset. If i do not pass that it seems to still render in the same location and work correctly. The biggest thing is then if I want the UI to re-position based on the resolution do i need to make another view just for the UI? or what is the correct way / best way to handle this?

Re: Render frame resize issue
« Reply #1 on: 23 January 2014, 05:04:40 »
Played around more and looks like if i update the position of each ui component and don't set draw(true) it works correctly. Is there still an easier solution? As my game could have a lot of UI components to do this on (not terrible but would definitely prefer a more hands off solution).

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Render frame resize issue
« Reply #2 on: 23 January 2014, 13:49:15 »
You should use a different view for sfml and tgui if you want to render them differently. Because you want the gui view to change with the resolution, you can't just pass true to the draw function (which is for changing sfml view while keeping the gui view).

So you will have to do something like this:
    set sfml view
    render with sfml

    set view for tgui
    render the gui

How to change the view is something that is explained in the sfml tutorials.
« Last Edit: 23 January 2014, 14:04:07 by texus »

Re: Render frame resize issue
« Reply #3 on: 26 January 2014, 01:24:04 »
ah makes sense and easy enough. thanks for the input!