Mask setup
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 7s
Create tag and build when new code gets to main / Export (push) Successful in 1m8s

This commit is contained in:
2026-01-31 10:18:27 +01:00
parent 9d2322b6c7
commit cd150a4513
11 changed files with 147 additions and 21 deletions

View File

@@ -1,7 +1,21 @@
@tool
extends Node2D
class_name Mask
@export var mask_resource: MaskResource:
set(new_resource):
mask_resource = new_resource
_on_mask_resource_changed()
if mask_resource == null:
return
mask_resource.changed.connect(_on_mask_resource_changed)
@onready var mask_sprite: Sprite2D = $MaskSprite
func _on_mask_resource_changed() -> void:
mask_sprite.texture = mask_resource.mask_sprite
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@@ -9,4 +23,17 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
if Engine.is_editor_hint():
_engine_process(delta)
else:
_game_process(delta)
func _game_process(delta: float) -> void:
pass
func _engine_process(delta: float) -> void:
if mask_resource == null:
return