mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 15:39:49 +00:00
9607981567
Slight optimization, as only one camera can now receive input at a time.
25 lines
690 B
GDScript
25 lines
690 B
GDScript
extends ViewportContainer
|
|
|
|
export(NodePath) var camera_path
|
|
|
|
onready var camera := get_node(camera_path) as Camera2D
|
|
|
|
|
|
func _ready() -> void:
|
|
material = CanvasItemMaterial.new()
|
|
material.blend_mode = CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA
|
|
|
|
|
|
func _on_ViewportContainer_mouse_entered() -> void:
|
|
camera.set_process_input(true)
|
|
Global.has_focus = true
|
|
Global.control.left_cursor.visible = Global.show_left_tool_icon
|
|
Global.control.right_cursor.visible = Global.show_right_tool_icon
|
|
|
|
|
|
func _on_ViewportContainer_mouse_exited() -> void:
|
|
camera.set_process_input(false)
|
|
Global.has_focus = false
|
|
Global.control.left_cursor.visible = false
|
|
Global.control.right_cursor.visible = false
|