Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
Grid-aware object rotation utilities for 2D grid-based games. Provides clean, typed helper functions for rotating objects on a grid with proper alignment to grid tiles, particularly for isometric and square tile layouts. Supports configurable rotation increments (90°, 45°, 30°, 60°, or any custom angle). Key features:
- Configurable rotation increments (4-direction, 8-direction, or any custom angle)
- Cardinal direction rotation (backward compatible, convenience API)
- Isometric-aware rotation handling with complex transform support
- Snap-to-grid positioning after rotation
- Integration with existing GridPositioner2D and PlacementPositioning2DUtils
- Static methods for easy testing and reuse Usage Examples:
- 4-direction (RTS-style): rotate_node_clockwise(node, map, 90.0)
- 8-direction (isometric with diagonals): rotate_node_clockwise(node, map, 45.0)
- 6-direction (hex-style): rotate_node_clockwise(node, map, 60.0)
- 12-direction: rotate_node_clockwise(node, map, 30.0) Designed to work seamlessly with the existing Grid Building plugin architecture while providing specialized rotation functionality for grid-based gameplay.
Source: addons/grid_placement/utils/placement_grid_rotation_utils.gd
Syntax
class PlacementGridRotationUtils extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
degrees_to_cardinal | Method | |
normalized | Property | |
rounded | Property | |
cardinal_to_degrees | Method | |
rotate_clockwise | Method | |
rotate_counter_clockwise | Method | |
rotate_node_clockwise | Method | |
current_rotation_deg | Property | |
new_rotation_deg | Property | |
target_global_rotation | Property | |
rotate_node_counter_clockwise | Method | |
current_rotation_deg | Property | |
new_rotation_deg | Property | |
target_global_rotation | Property | |
set_node_direction | Method | |
target_global_rotation | Property | |
get_direction_tile_delta | Method | |
get_opposite_direction | Method | |
is_horizontal | Method | |
is_vertical | Method | |
direction_to_string | Method | |
current_tile | Property | |
normalized | Property | |
rotate_and_move_node | Method | |
result | Property | |
move_delta | Property | |
parent_node | Property | |
parent_2d | Property | |
original_global_position | Property | |
target_global_transform | Property | |
parent_global_transform | Property | |
required_local_transform | Property | |
required_local_rotation | Property |
Source
addons/grid_placement/utils/placement_grid_rotation_utils.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs