23 lines
426 B
GDScript
23 lines
426 B
GDScript
tool
|
|
extends Polygon2D
|
|
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
|
|
func _update_size(new_aspect_ratio):
|
|
print("We got here")
|
|
var calculated_aspect_ratio = new_aspect_ratio.x / new_aspect_ratio.y
|
|
polygon = PoolVector2Array(
|
|
[
|
|
Vector2.ZERO,
|
|
Vector2(calculated_aspect_ratio, 0.0),
|
|
Vector2(calculated_aspect_ratio, 1.0),
|
|
Vector2(0.0, 1.0)
|
|
]
|
|
)
|
|
|
|
func _on_view_transform_changed(new_view_transform):
|
|
transform = new_view_transform
|