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

UI Scale factor #14

Open
Distortions81 opened this issue Jul 5, 2021 · 10 comments
Open

UI Scale factor #14

Distortions81 opened this issue Jul 5, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@Distortions81
Copy link

It would be great if there was UI scale factor, to enlarge/shrink the entire UI.
People can implement it themselves, but it would be nice if the library just took care of it.

@blizzy78 blizzy78 added the enhancement New feature or request label Jul 5, 2021
@mcarpenter622
Copy link
Collaborator

@Distortions81 Hello! I am the new maintainer of this library. This is an interesting idea. I will leave this open as a potential enhancement!

@peakle
Copy link

peakle commented Nov 11, 2023

Did anyone knows how I can scale the button size right now?

@mcarpenter622
Copy link
Collaborator

@peakle So I was playing with one way of handling a UI scale factor for the entire UI. The problem as I see it is that it kinda makes fonts look like crap. It is also shifting everything to the bottom right corner. Take a look at these screenshots and let me know if it seems useful?

Normal
image

1.5X Scale
image

@mcarpenter622
Copy link
Collaborator

I could try to make the main container width = the new window size..

@mcarpenter622
Copy link
Collaborator

Actually yes, that does make things a bit better:
image

@mcarpenter622
Copy link
Collaborator

There is still the issue with the fact I am scaling the image so things are a little grainy

@mcarpenter622
Copy link
Collaborator

If people think this change would be useful even given the issues with the scaling, let me know and I can push it up.

Also, if anyone has suggestions on how to deal with the font/image issues due to scaling, I am open to that as well.

To answer @peakle 's question. I think the cleanest way to implement scaling is still on the client side. Set a few predefined scales 1, 1.25, 1.5 etc and have separate UI assets for each scale, that you switch between.

I think a longer term solution would be for me to finally consider that template idea I have been toying with. Essentially a file that defines standard images/fonts etc per widget that you could use to define that all in one place and then have the capability to switch which template you're using. That one is a ways off though.

@peakle
Copy link

peakle commented Nov 11, 2023

@mcarpenter622 thanks for your answer, can you provide a code example?

I don't know much about library context right now, so i don't know how to reproduce: >I could try to make the main container width = the new window size..

i tried to play with code through container min size + widget min size, but it looks little wierd (img. 1) instead of (img. 2):
Снимок экрана 2023-11-11 в 23 18 54
Снимок экрана 2023-11-11 в 23 19 18

@mcarpenter622
Copy link
Collaborator

mcarpenter622 commented Nov 11, 2023 via email

@quasilyte
Copy link
Contributor

quasilyte commented Nov 12, 2023

I shared some of my thoughts on Mark's discord server.

I think the original issue is more about making the buttons "taller" more easily.
In my opinion, the ui scaling thing should not be implemented in a hurry for a use case that could live without it.
Let's split this issue in two: making it easier for a user to make taller buttons and the ui scaling toggle itself. Most people will use the default widget examples and they show how to use a button that scales horizontally, but it's hard to make it taller without tearing the sprite.

@mcarpenter622 do you have a use case for this feature so you can properly design and test it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

5 participants