GraphicsEditor/addons/graphics_editor/ViewportContainer.gd

9 lines
248 B
GDScript3
Raw Normal View History

2019-08-04 09:57:42 +02:00
extends ViewportContainer
func _ready():
pass
func _notification(what):
if what == Control.NOTIFICATION_RESIZED:
2019-08-05 02:16:14 +02:00
get_node("Viewport").size = rect_size
get_node("Viewport/Node2D/Camera2D").position = Vector2(rect_size.x / 2, rect_size.y / 2)