src / stages / frame / camera_frame.tscn

Diagram

Diagram

Scene Tree

  • CameraFrame Area2D

    • CollisionShape2D CollisionShape2D

Signal Connections

Note
No signal connections.

Properties

Table 1. Root properties
Name Value

collision_layer

4

collision_mask

4

script

Table 2. $CollisionShape2D properties
Name Value

unique_name_in_owner

true

shape

SubResource("RectangleShape2D_jyj6x")

debug_color

Color(1, 0.23921569, 0.5372549, 0.03529412)

camera_frame.gd

extends Area2D

const HALF_SIZE = Vector2(1920, 1080) / 2


static func corner_of(area: Area2D) -> Dictionary:
	return {
		"left":   area.global_position.x - HALF_SIZE.x,
		"right":  area.global_position.x + HALF_SIZE.x,
		"top":    area.global_position.y - HALF_SIZE.y,
		"bottom": area.global_position.y + HALF_SIZE.y,
	}


func corner() -> Dictionary:
	return corner_of(self)