Grid Placement

GBGridRotationUtils

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: utils/gb_grid_rotation_utils.gd

Version: 5.0

class_name: GBGridRotationUtils extends: RefCounted

Summary

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 GBPositioning2DUtils
  • 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.

Signals

(none)

Exports

(none)

Methods

(none)