PirateTreasureHunt/editor/Camera2D.gd

23 lines
538 B
GDScript
Raw Normal View History

2021-06-13 20:40:05 +02:00
extends Camera2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func ScreenToWorld (pos_screen: Vector2):
var camera_offset = OS.get_window_safe_area().size * 0.5 * zoom - transform.origin
return (pos_screen * zoom - camera_offset)
func WorldToScreen (pos_world: Vector2):
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass