+1 vote

How can I find the global position of the corners of my camera, even though it stretches in Expand Aspect mode.

in Engine by (351 points)

1 Answer

0 votes

Hey usurun,
I think that

var upper_left_corner = $Camera2D.global_position - OS.window_size/2

would be a valid workaround for the upper left corner.

Good luck!

by (864 points)

Probably why you got a down vote then was because the var didn't have the onready before it and it didn't work so you show have put this:

onready var upper_left_corner = $Camera2D.global_position - OS.window_size/2

Instead of this:

var upper_left_corner = $Camera2D.global_position - OS.window_size/2

Edit: nvm for some reason it's kind of broken
Another Edit: The x is alright but the y is not

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.