Godot Hot Code

This is intended as a cheat sheet for Godot, but I haven't kept working on Godot, so it's super basic right now.

Get Screen Size

Tags: gdscript

OS.get_screen_size() # The full computer screen size
OS.get_window_size() # Just gets the game window
get_viewport().size # .x / .y for width/height. Just the game window

Get Mouse Position

Tags: gdscript

var pos = get_viewport().mouse_position()