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: force a particular scaling factor #89

Open
euclio opened this issue Jun 14, 2020 · 3 comments
Open

Feature request: force a particular scaling factor #89

euclio opened this issue Jun 14, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@euclio
Copy link

euclio commented Jun 14, 2020

I recently ported my emulator to use pixels, and it's great! I love the automatic scaling to the window size.

However, I would also like to allow my users to select a scaling factor that they prefer, regardless of window size. I tried passing my own values to pixels.resize, but this doesn't do what I want.

@parasyte parasyte added the question Usability question label Jun 15, 2020
@parasyte
Copy link
Owner

parasyte commented Jun 15, 2020

pixels doesn't integrate directly with any windowing provider (like winit or sdl2), If you want to resize the window, you need to use the API supported by your window provider. After resizing the window, you can call the resize method to fit the output texture to the window. (This is usually going to be called in response to resizing the window as part of application-specific integration with a window provider.)

Does that help? I don't think there is anything more pixels can do to resize your window.

The scaling factor is a function of window size and pixel buffer size. E.g. a pixel buffer of 160x120 can comfortably fit in a window size 320x240 at 2x scale, but it will not fit in the same window with a 3x scale.

If you are talking about allowing non-integer scaling, like 2.386x, that's a feature that can be added.

@euclio
Copy link
Author

euclio commented Jun 15, 2020

Sorry, let me clarify. To use your example of a 160x120 pixel buffer, I would like the ability to force the scale of the buffer display to 1x or 2x, even if the window itself is much larger (say, 640x480) and could support a scale of 4x.

@parasyte
Copy link
Owner

Ok. It would just be a fixed scaling factor instead of dynamic (based on window inner size). This can be done.

@parasyte parasyte added enhancement New feature or request good first issue Good for newcomers and removed question Usability question labels Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants