Grid Placement

RuleCheckIndicator

AUTO-GENERATED (GDScript) API entry

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: placement/rule_check_indicator/rule_check_indicator.gd

Version: 5.0

class_name: RuleCheckIndicator extends: ShapeCast2D

Signals

  • valid_changed(is_valid: bool)

Exports

  • validity_sprite: Sprite2D = null
    • Whether to show the indicator visual sprites for players or not.
  • _group
    • Whether to show the indicator visual sprites for players or not.
  • show_indicators
  • valid_settings: IndicatorVisualSettings
    • Cache whether debug drawing should be active to avoid checking each frame
  • invalid_settings: IndicatorVisualSettings
    • Cache whether debug drawing should be active to avoid checking each frame
  • rules

    • Displays visual feedback for tile validity during building preview by running all assigned TileCheckRules and updating its visuals accordingly.
    • Used by IndicatorManager and PlacementValidator as part of the validation pipeline. [br][br]
    • Usage: It is recommended to set the TargetPosition to Vector2(0,0) so that the indicator’s position aligns with the tile being evaluated. [br][br]
    • [b]IMPORTANT FOR ISOMETRIC GAMES:[/b] This ShapeCast2D should use [ConvexPolygonShape2D] with explicit
    • diamond points, NOT [RectangleShape2D] with skew transformation. When the parent [ManipulationParent]
    • rotates (e.g., 90° during manipulation), skewed rectangles create visual distortion due to compound
    • transforms (skew + rotation). Polygon shapes rotate uniformly without perspective changes. [br][br]
    • For detailed explanation and examples, see: [code]docs/v5-0-0/guides/isometric_implementation.mdx[/code][br][br]
    • See [code]project-architecture.md[/code] for system architecture and building flow documentation.
  • valid

    • Usage: It is recommended to set the TargetPosition to Vector2(0,0) so that the indicator’s position aligns with the tile being evaluated. [br][br]
    • [b]IMPORTANT FOR ISOMETRIC GAMES:[/b] This ShapeCast2D should use [ConvexPolygonShape2D] with explicit
    • diamond points, NOT [RectangleShape2D] with skew transformation. When the parent [ManipulationParent]
    • rotates (e.g., 90° during manipulation), skewed rectangles create visual distortion due to compound
    • transforms (skew + rotation). Polygon shapes rotate uniformly without perspective changes. [br][br]
    • For detailed explanation and examples, see: [code]docs/v5-0-0/guides/isometric_implementation.mdx[/code][br][br]
    • See [code]project-architecture.md[/code] for system architecture and building flow documentation.
  • [Settings]

Methods

  • _init(p_rules: Array)
    • Set target_position to zero for proper tile alignment in tests
  • _ready
  • _physics_process(_delta: float) -> void
  • resolve_gb_dependencies(p_container: GBCompositionContainer) -> void
  • get_rules -> Array
  • add_rule(p_rule: TileCheckRule)
  • _on_tree_entered_validate
  • get_tile_position(p_map: TileMapLayer) -> Vector2i
  • clear
  • validate_rules(p_rules: Array) -> Array
    • Build a failing_checker callable that captures this indicator but passes only the rule to the helper
  • _indicator_debug_enabled -> bool
    • Determine whether debug drawing should be enabled.
  • _indicator_log_enabled -> bool
  • _update_visuals(p_display_settings: IndicatorVisualSettings) -> Sprite2D
    • Fail-fast for missing display settings only; if there’s no sprite, just skip visuals
  • _update_current_display_settings(p_display_rules: Array, p_is_valid = null)
    • Use passed validity state if provided, otherwise fall back to class property
  • _find_highest_rule_with_visual_settings(p_rules: Array) -> TileCheckRule
    • Find the highest priority failing rule with fail visual settings
  • _draw
    • Fast exit if debug draw is disabled
  • get_debug_info -> Dictionary
  • validate_runtime -> bool
    • Avoid hard assertion - tests may construct indicators without a logger.
  • trace_runtime_if_enabled -> void
    • Debug logging for setup (logger decides verbosity). Skip if logger missing.
  • get_runtime_issues -> Array
    • Start with editor-time issues so runtime includes all authoring checks
  • get_editor_issues -> Array
    • Visual assets/settings that should be assigned for proper authoring
  • _on_debug_settings_changed -> void
  • _update_debug_cached_state -> void
  • update_validity_state -> bool
  • force_validity_evaluation -> bool
  • _on_valid_changed(is_valid: bool)
  • _debug_setting_float_or(default_value: float, getter_name: String) -> float
  • _debug_setting_color_or(default_value: Color, getter_name: String) -> Color