Skip to content

Grid Placement v6.0

Directional Sprite Rotation Demo

Demo of directional sprite rotation in Grid Placement 6.0.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

Use this 2D pattern for objects with authored N/E/S/W art.

Grid Placement still advances the logical/cardinal orientation so footprint, placement validity, and manipulation state stay correct. The visible sprite can swap to the authored frame instead of visually spinning.

ManipulatableSettings.disable_rotation_transform supports this presentation workflow. It suppresses the normal visual rotation transform; it does not mean the object's logical placement orientation/footprint can be ignored.

Demo flow

  1. Select Directional Bench in the top-down demo.
  2. Place it.
  3. Rotate it through the cardinal directions.
  4. Confirm that the non-square footprint/indicators change orientation while the bench swaps to the matching authored frame without looking like a rotated bitmap.

Relevant files:

  • demos/top_down/objects/directional_sprite_rotation_demo.gd — direction/frame handling.
  • demos/top_down/objects/directional_bench.tscn — non-square demo object.
  • demos/top_down/placement/placeables/placeable_directional_bench.tres — catalog entry.

Consumer callback

Use the supported rotation/cardinal callback to select the art for the new direction. Keep the callback focused on presentation; do not manually rewrite placement occupancy/footprint state.

Conceptually:

func _on_rotated(
    _new_rotation_degrees:float,
    cardinal:PlacementGridRotationUtils.CardinalDirection
)-> void:
    directional_sprite.texture= directional_frames[cardinal]

The same pattern can drive other authored cardinal presentation while Grid Placement remains authoritative for logical placement rotation.

See Manipulation for the manipulation lifecycle and rotation rules.