-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rework content scale to provide more options, add integer scaling #63206
Conversation
- Add content stretch modes Fractional (default), Integer and Hybrid. - All modes with with any stretch mode and aspect. - Fractional behaves as Godot currently does when scaling viewports. Pixel art will only look good when the window is scaled at multiples of the original size. - Integer enforces an integer scale for the final display (rounded down from the automatically computed fractional scale). Black bars may be displayed on all sides when using the `viewport` stretch mode. This provides crisp pixel art appearance. - Hybrid enforces an integer scale on the internal rendering resolution, but the viewport will be stretched down to the final display with linear filtering. This provides good pixel art appearance, though not as crisp as the Integer mode. - Tweak project setting for stretch scale to allow values as low as 0.5 (values below 1 are valid, and can be useful for UI testing purposes). TODO: - Implement hybrid filtering mode.
4142954
to
3490b9b
Compare
I've just attached a minimal hybrid scaling project for Godot 3 implemented in nodes: godotengine/godot-proposals#1666 (comment) Hope it helps! |
Maybe I don't fully understand how to use this, but I don't see what I expect to see with integer scaling. When I resize the window, the new integer scale isn't automatically chosen. Instead, there is a smooth fractional scaling. Ideally I'd like to have 2 approaches:
|
Is there a reason why the content scale feature is implemented on I have a project that uses viewports to contain multiple game instances in the same window. It would be nice to be able to scale the canvas items (i.e. GUI) in each viewport instead of globally on the window. |
I need help to finish this feature. If you want to see this for 4.0, please lend a hand 🙂
cc @Yukitty, @starry-abyss
Add content stretch modes Fractional (default), Integer and Hybrid.
viewport
stretch mode. When using thecanvas_items
stretch mode, no black bars are displayed (unless the stretch aspect requires it), but the game's viewable area will change in 2D.Tweak project setting for stretch scale to allow values as low as 0.5 (values below 1 are valid, and can be useful for UI testing purposes).
Testing project: test_stretch_master.zip
TODO
This closes godotengine/godot-proposals#1666.