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.

godotengine.org | Twitter

0 votes

Hi,
On my android device, get_viewport().get_rect().size returns (1920, 1080);
But when i track a sprite position, and that sprite reach the right side, his x position is 1280.

And my pc (test) where the screen size is (1280, 720) when the sprite reach the right side, his x position is ~1275 which is correct.

Anyone know how to fix that, or am i just doing things in the wrong way to get the screen size ?

You can download the project at this link.

in Engine by (30 points)
edited by

1 Answer

0 votes
Best answer

My god!
All this time i was stuck on this dummy problem was because of the stretch_mode who was set on 2d (i watched a tutorial on how to keep my UI responsive and the guy said to switch on 2d) !

To keep responsive, stretch_mode must be on viewport !

by (30 points)

Any chance you could provide a link or any sort of instructions about this solution?

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.