Grid Placement
Development ⚠️ GridPlacement 6.0 (GECS) is in active development. This is the GDScript ECS architecture.

GridComponent

AUTO-GENERATED (GDScript) API entry

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: components/grid/grid_component.gd

Version: 6.0

class_name: GridComponent extends: Component

Signals

(none)

Exports

  • grid_id: String = ""
    • Grid dimensions (width x height in cells)
    • Size of each grid cell in world units
    • Grid origin in world coordinates
    • Whether this grid uses isometric coordinates
    • Grid visibility for debugging
    • Grid color for visualization
    • Initialize component with grid data
  • grid_size: Vector2i = Vector2i(32, 32)
  • cell_size: Vector2 = Vector2(32, 32)
  • origin: Vector2 = Vector2.ZERO
  • isometric: bool = false
  • show_grid: bool = false
    • Grid color for visualization
    • Initialize component with grid data
  • grid_color: Color = Color.WHITE
    • Initialize component with grid data

Methods

  • _init(grid_size: Vector2i = Vector2i(32, 32)
  • _init(data: GridData = null) -> void
  • world_to_grid(world_pos: Vector2) -> Vector2i
  • grid_to_world(grid_pos: Vector2i) -> Vector2
  • grid_to_world_corner(grid_pos: Vector2i) -> Vector2
  • is_valid_grid_position(grid_pos: Vector2i) -> bool
  • is_world_position_in_grid(world_pos: Vector2) -> bool
  • get_neighbors(grid_pos: Vector2i, distance: int = 1) -> Array
  • get_grid_distance(from: Vector2i, to: Vector2i) -> int
  • snap_to_grid(world_pos: Vector2) -> Vector2
  • get_world_bounds -> Rect2
  • validate -> Array
  • _to_string -> String