Add sandbox stage builder scripts and functionality
- Introduced StageGizmos for hover highlighting, selection outlines, and rotation handles in the sandbox stage builder. - Added StageGrid for an optional world-space grid overlay that adjusts with camera panning and zooming. - Implemented StageSelection for geometric hit-testing and selection management of nodes in the sandbox. - Created StageSpawner as a registry-driven factory for spawning terrain, props, and stickmen, allowing for dynamic template management. - Each script includes necessary constants, state management, and public API methods for interaction.
This commit is contained in:
@@ -233,9 +233,14 @@ static func _mount_shapes(stk_data: Dictionary, rig: Node2D) -> void:
|
||||
var part_data: Variant = body_parts.get(part_name, {})
|
||||
if part_data is Dictionary:
|
||||
var pd := part_data as Dictionary
|
||||
var shapes_var: Variant = pd.get("shapes", [])
|
||||
if shapes_var is Array:
|
||||
shapes = shapes_var as Array
|
||||
if pd.has("shapes"):
|
||||
var shapes_var: Variant = pd.get("shapes")
|
||||
if shapes_var is Array:
|
||||
shapes = shapes_var as Array
|
||||
elif pd.has("points"):
|
||||
# v1.0/v1.1 single-shape format: the part dict is itself one
|
||||
# shape (wrapped like the editor's load path).
|
||||
shapes = [pd]
|
||||
# Phase 9 Round 3: the preview's per-part rotation (degrees) and
|
||||
# scale about the bbox center are applied to the mounted geometry.
|
||||
rotation_deg = float(pd.get("rotation", 0.0))
|
||||
|
||||
Reference in New Issue
Block a user