The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

As document says :

'' Godot currently doesn't have a way to enforce integer scaling when using the canvas_items or viewport stretch mode, which means pixel art may look bad if the final window size is not a multiple of the base window size. To fix this, use an add-on such as the Integer Resolution Handler ''

godot currently does not support enforce integer scaling viewport, and then point out a plugin doing this job. The plugin do accomplish this job, but it does not work for 4.x as API changes a lot.

After searching through documents and source files, I still can't find these APIs to do what I want, so I come here for help.

Godot version 4.0.x
in Engine by (15 points)

Okay, I find DisplayServer singleton just now, I think. I think i can do it by query screen size from DisplayServer and set ViewPort's canvas_transform. Is it correct?

Okay, I find that Camera2D will modify the viewport's cavas_transform, and makes any change from other modification invalid, so what's the proper way to do this?

I finally found Window and Window.contentscalefactor to expand window

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.