Files
EGJ25/addons/guide/editor/utils.gd
minimata 9a79715e47
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 3m16s
feat: made sure the aspect ration fit a pixel art game and added useful addons
2025-06-27 15:19:12 +02:00

22 lines
720 B
GDScript

## Removes and frees all children of a node.
static func clear(node:Node):
if not is_instance_valid(node):
return
for child in node.get_children():
node.remove_child(child)
child.queue_free()
## Checks if the given resource is an inline resource. If so, returns a shallow copy,
## otherwise returns the resource. If the resource is null, returns null.
static func duplicate_if_inline(resource:Resource) -> Resource:
if is_inline(resource):
return resource.duplicate()
return resource
## Checks if the given resource is an inline resource.
static func is_inline(resource:Resource) -> bool:
if resource == null:
return false
return resource.resource_path.contains("::") or resource.resource_path == ""