Grid Placement

GBGridRotationUtils

AUTO-GENERATED (GDScript) API entry

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: utils/gb_grid_rotation_utils.gd

Version: 5.0

class_name: GBGridRotationUtils extends: RefCounted

Signals

(none)

Exports

(none)

Methods

  • degrees_to_cardinal(degrees: float) -> CardinalDirection
    • Normalize to 0-360 range
  • cardinal_to_degrees(direction: CardinalDirection) -> float
  • rotate_clockwise(current: CardinalDirection) -> CardinalDirection
  • rotate_counter_clockwise(current: CardinalDirection) -> CardinalDirection
  • rotate_node_clockwise(node: Node2D, map: TileMapLayer, increment_degrees: float = 90.0, snap_to_grid: bool = true) -> float
    • Calculate the local rotation needed to achieve the target global rotation
  • rotate_node_counter_clockwise(node: Node2D, map: TileMapLayer, increment_degrees: float = 90.0, snap_to_grid: bool = true) -> float
    • Calculate the local rotation needed to achieve the target global rotation
  • set_node_direction(node: Node2D, direction: CardinalDirection, map: TileMapLayer, snap_to_grid: bool = true) -> void
    • Calculate the local rotation needed to achieve the target global rotation
  • get_direction_tile_delta(direction: CardinalDirection) -> Vector2i
  • get_opposite_direction(direction: CardinalDirection) -> CardinalDirection
  • is_horizontal(direction: CardinalDirection) -> bool
  • is_vertical(direction: CardinalDirection) -> bool
  • direction_to_string(direction: CardinalDirection) -> String
  • _snap_node_to_grid(node: Node2D, map: TileMapLayer) -> void
  • _normalize_degrees(degrees: float) -> float
  • rotate_and_move_node(node: Node2D, rotation_direction: int, movement_direction: CardinalDirection = CardinalDirection.NORTH, map: TileMapLayer = null, move_after_rotation: bool = false) -> Dictionary
  • _set_node_global_rotation(node: Node2D, target_global_rotation: float) -> void