Grid Placement

GridPositioner2D

AUTO-GENERATED (GDScript) API entry

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: systems/grid_targeting/grid_positioner/grid_positioner_2d.gd

Version: 5.0

class_name: GridPositioner2D extends: Node2D

Signals

(none)

Exports

(none)

Methods

  • _init -> void
  • _ready -> void
    • Start invisible until proper dependencies are injected
  • _physics_process(delta: float) -> void
    • Positioner no longer depends on shapecast; physics tick retained only for optional diagnostics.
  • _process(delta: float) -> void
    • Optional debug: detect external visibility changes vs expected computation
  • set_input_processing_enabled(p_enabled: bool) -> void
  • is_input_processing_enabled -> bool
  • is_input_ready -> bool
  • are_dependencies_ready -> bool
  • resolve_gb_dependencies(p_config: GBCompositionContainer) -> void
    • Forward to explicit dependency injection helper to avoid service locator usage.
  • _input(event: InputEvent)
    • Guard: Return early if critical dependencies are not yet injected
  • _handle_mouse_motion_event(motion: InputEventMouseMotion, current_mode: GBEnums) -> void
    • Apply mouse input gate (always check, regardless of mode)
  • _convert_screen_to_world(screen_pos: Vector2) -> Vector2
    • Get viewport using fail-fast approach
  • _move_to_cached_mouse_world -> Vector2i
  • _cache_current_world_position -> void
  • _get_active_viewport -> Viewport
  • _get_active_camera(p_vp: Viewport) -> Camera2D
  • _is_disabled_in_off_mode -> bool
  • _is_mouse_cursor_on_screen -> bool
  • _is_mouse_follow_allowed -> bool
  • _mouse_input_gate -> bool
  • _apply_mouse_world(world: Vector2, method: int, screen: Vector2) -> void
    • Cache
  • _log_mouse_motion(p_method: int, p_screen: Vector2, p_world: Vector2) -> void
  • _log_mouse_gate(p_allowed: bool) -> void
    • Only log when state changes to reduce spam
  • _apply_recenter_on_enable -> void
  • _apply_positioning_and_visibility_sequence -> void
    • First apply positioning (requires Camera2D to be ready)
  • _recenter_decision_to_string(p_decision: int) -> String
  • _handle_mouse_movement(mouse_global_override: Variant = null) -> void
    • Diagnostics: log guard state for mouse movement handling
  • _move_positioner_by_tile(p_tile_delta: Vector2i) -> void
  • move_to_viewport_center_tile -> Vector2i
  • move_to_cursor_center_tile -> Vector2i
  • _apply_recenter -> void
  • get_last_manual_recenter_mode -> int
  • _exit_tree -> void
  • remove_self_as_positioner
  • update_visibility -> void
    • Recalculate desired visibility based on current mode and settings
  • should_be_visible -> bool
    • If mode/state not ready, keep current visibility to avoid flicker
  • set_dependencies(p_states: GBStates, p_config: GBConfig, p_logger: GBLogger = null, p_actions: GBActions = null, enable_input: bool = true) -> void
  • get_runtime_issues -> Array
    • Validate required injected states
  • validate_dependencies -> bool
  • _on_mode_changed(p_mode: GBEnums)
    • Apply positioning when entering build mode (to ensure positioner is visible on screen)
  • _should_be_visible_for_mode(p_mode: GBEnums) -> bool
  • get_visual_node -> Node
  • is_visual_visible -> bool
  • _set_visible_state(p_visible: bool) -> void
  • log_current_visual_state
  • _schedule_end_of_frame_state_log -> void
  • _log_end_of_frame_state_async -> void
  • _log_screen_and_mouse_state
  • _visibility_context(visual: CanvasItem) -> String
  • is_positioner_active -> bool
  • should_hide_under_handled_ui -> bool
  • are_dependencies_resolved -> bool
  • to_diagnostic_string -> String
    • Defensive: provide diagnostic info even if dependencies aren’t fully resolved
  • _set_visibility_reason(p_reason: String) -> void
  • _visibility_decision_trace -> String
    • Pass a Dictionary snapshot (public API) to the logic helper to satisfy its typed signature
  • _get_debug_log_mode -> GBDebugSettings
  • _is_logging_mode(p_mode: GBDebugSettings) -> bool
  • _is_visibility_logging_enabled -> bool
  • _is_mouse_input_logging_enabled -> bool
  • _is_positioning_logging_enabled -> bool
  • _is_state_flow_logging_enabled -> bool
  • _log_debug(p_mode: GBDebugSettings, p_message: String, p_throttled: bool = true) -> void
  • _log_visibility(p_message: String, p_throttled: bool = true) -> void
  • _log_mouse(p_message: String, p_throttled: bool = true) -> void
  • _log_positioning(p_message: String, p_throttled: bool = true) -> void
  • _log_state_flow(p_message: String, p_throttled: bool = true) -> void
  • _test_convert_screen_to_world(screen_pos: Vector2) -> Vector2
  • _test_get_tile_center_from_screen(screen_pos: Vector2) -> Dictionary
  • _apply_visibility_result(p_result: MouseEventVisibilityResult) -> void