Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: some way to scale GUIs #1656

Closed
ericoporto opened this issue May 9, 2022 · 5 comments
Closed

Feature request: some way to scale GUIs #1656

ericoporto opened this issue May 9, 2022 · 5 comments
Labels

Comments

@ericoporto
Copy link
Member

ericoporto commented May 9, 2022

Describe the problem
Rooms now have the concept of Camera and Viewport which allows it to adapt in different ways to a different Screen Size - as in the AGS in-game resolution. It would be useful if GUIs had some way to adapt too.

One feature that would help, would be some way to modify the GUI size in a way it scales, along with all controls in it - if the GUI width and height were it's camera width and height, you can think of the scaling as the target viewport.

For my right away use, it would be to scale GUIs when I am scaling the screen so they can match, and I can have the rooms in a higher resolution - which allows me to implement a smoother game camera.

Suggested change
Either a game wide GUI scaling parameter or some per GUI scaling setting. Alternatively some projection width/height.

Considerations

  • in non-pixelart games, it may be desired that the fonts are drawn at screen size if the UI is scaled up or down to avoid blurriness
  • advanced scaling techniques may require a layout system for GUIs which may make their development more complex
  • while there are means to provide UI scaling baked in GUI systems in more advanced game engines, they also are reportedly more complex to use, while AGS has a very easy to use UI system, we could still look into how scaling is done in these engines.
  • the scaling proposed here is the simplest as possible that decouples the GUI resolution from the game screen resolution

additional context

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented May 9, 2022

In AGS 4 branch the cursor interaction (hit tests) are already taking transformations into account, because of rotation support. So adding visual scaling to GUIs alone is trivial, and is mostly a matter of API. I'm not completely sure if that's the kind of effect you're refering to though; so this got to be clarified.

OTOH may be related, esp. in regards to the text resolution, there's one draft idea: #980

@ericoporto
Copy link
Member Author

ericoporto commented May 9, 2022

Yes, the scaling I am referring is the same there, a transformation. For pixel art aesthetic that is fine and works great!


I just have concerns that someone will ask a feature similar to "Render character in screen resolution", but for texts, once the GUI can be scaled and not "be in screen resolution" - again, thinking of this parallel with scaled characters. Maybe I am overthinking.


#980 looks like more concerned on how to accomplish, and here I am more worried at the what (API and design).

@ericoporto
Copy link
Member Author

A PR for this issue is in #2426.

@ivan-mogilko
Copy link
Contributor

#2426 is now merged, and its effect corresponds to the following paragraph from this ticket:

One feature that would help, would be some way to modify the GUI size in a way it scales, along with all controls in it - if the GUI width and height were it's camera width and height, you can think of the scaling as the target viewport.

if that covers current ticket, then it should be closed as resolved. If not, then some clarification should be added.

@ericoporto
Copy link
Member Author

It does! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants