Skip to content

Class

PlacementGridRotationUtils

Generated GDScript class reference for GridPlacement.PlacementGridRotationUtils.

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

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 RefCounted

Members

NameKindSummary
degrees_to_cardinalMethod
cardinal_to_degreesMethod
rotate_clockwiseMethod
rotate_counter_clockwiseMethod
rotate_node_clockwiseMethod
rotate_node_counter_clockwiseMethod
set_node_directionMethod
get_direction_tile_deltaMethod
get_opposite_directionMethod
is_horizontalMethod
is_verticalMethod
direction_to_stringMethod
rotate_and_move_nodeMethod
resultProperty
move_deltaProperty