GBActionBar
NOTE: Script now expected to...
Core API reference for core classes in GridBuilding v5-0
This section contains the API reference for all core classes in the GridBuilding v5-0 plugin.
Limit the desired tile so it does not exceed the configured max distance from the source node. [param source] Node whose tile is used as the origin for distance checks. [param target_tile] Desired tile to clamp. [param map] Map used for conversions and fallback region data. [param settings_override] Optional override for targeting settings. [return] Tile respecting adjacency and region limits.
NOTE: Script now expected to be attached to the internal Buttons HBox inside a PanelContainer wrapper. Root PanelContainer provides background; this HBox preserves previous API assumptions.
Validates button configuration and dependencies. Returns list of validation issues found.[br][br] [code]return[/code]: [i]Array[String][/i] - List of validation issues (empty if valid)
Handles mode change events and outputs to action log if enabled
Make sure each action is set in the input map
Gets diagnostic information about a folder’s contents
Runtime validation for game startup Call this during game initialization to verify setup
Helper to get the center of the camera’s viewport rectangle
[b]Circle tile pruning[/b] Generic pruning based on the distance of the tile center from the circle center. Excludes extreme corner tiles whose centers lie beyond [code]radius + half_tile[/code] allowance. [b]Returns[/b]: bool – [code]true[/code] if the tile is allowed.
Internal helper to get debug settings without logging (for logger initialization)
Lazy inits sub resources that have not been defined in the Godot inspector.
Highly recommended to call this deferred on ready for your main gameplay scene to allow all nodes to be properly added to the scene AND injected by the GBInjectorSystem before validation
Validates editor configuration before nodes are set up. This should be called during the editor setup phase.[br] Returns:[br] [b]Array[String][/b] - List of editor configuration issues (empty if valid)
Injectable control for display grid building related information for the owning object.
Optional component for changing the cursors when the grid builder mode state changes.
Get any runtime issues detected for this resource.
Safe wrapper for getting tile position from global position. Handles both TileMapLayer and test objects with duck-typed interface. [param global_position] The world position to convert. [param map] The map object (TileMapLayer or duck-typed equivalent). [return] The tile coordinate as Vector2i, or Vector2i.ZERO if conversion fails.
Convert ProjectionMethod enum to string
Base class for a node that is attached to gameplay objects for grid building operations
Fallback for square tiles, uses bounding box intersection
Checks if a tile is covered by a CollisionPolygon2D (using Geometry2D intersection) Returns true if a tile is covered by a CollisionPolygon2D, using intersection area (with epsilon threshold). Useful for strict collision checks between tiles and collision polygons. tile_type: TileSet.TileShape (required) epsilon: minimum intersection area to count as covered (default 0.01)
Helper function to set a node’s rotation to achieve a target global rotation [param node] Node2D to rotate [param target_global_rotation] Desired global rotation in radians
Helper method to manually inject dependencies into this object. Useful when creating RefCounted objects that need injection outside of the normal flow.[br][br] [code]container[/code]: [i]GBCompositionContainer[/i] - The dependency container
Creates and injects any RefCounted object that implements resolve_gb_dependencies. Generic factory method for objects that follow the injection pattern.[br][br] [code]constructor_args[/code]: [i]Array[/i] - Arguments to pass to the constructor (optional)
[b]Private helper: Report warnings through direct print or push_warning.[/b][br]
Validate setup and return a list of issues with the current object
Change the level of the GBDebugSettings to change how much information is logged
[code]p_target[/code]: [i]Node[/i] - The node to re-enable
Holds the last mouse input gate/projection snapshot for grid-based input systems Provides typed properties and a convenience serializer to Dictionary
Abstract method to resolve dependencies for a given GBCompositionContainer. This method should be overridden in derived classes to implement specific dependency resolution logic.
Use this base for Node2D-derived components that are part of plugin systems, so they receive consistent DI and lifecycle behavior expected across the project.
Gets a readable display name for a Node, with optional fallback and custom callable. [code]node[/code]: [i]Node[/i] - Node to get display name for (can be null) [code]missing_name[/code]: [i]String[/i] - Value to return when node is null or name missing [code]custom_callable[/code]: [i]Callable[/i] - Optional callable that receives the node and returns a String
Validates that all required dependencies and properties are properly set. Returns validation issues if dependencies are missing, empty array if valid.[br][br] [code]return[/code]: [i]Array[String][/i] - List of validation issues (empty if valid)
Validates the runtime configuration after nodes are set up. [code]@return[/code]: [i]Array[String][/i] - List of runtime validation issues.
Convert an arbitrary direction vector into an 8-direction tile delta (-1/0/1 per axis). Perfect for 2D grid-based movement systems supporting 8-directional input (WASD + diagonals). Cardinal and diagonal directions are supported; tiny components are snapped to 0 by threshold. [param direction] The input direction from joystick, keyboard, or mouse (any Vector2). [param threshold] Components with absolute value below this are treated as 0 (default 0.33). [return] Vector2i with components in {-1, 0, 1} representing tile movement direction. [b]Example:[/b] Vector2(0.8, -0.2) becomes Vector2i(1, 0) for rightward movement.
Get a string identifying name for the resource for debugging purposes
Require Camera2D node present in the viewport for positioning utilities
Returns true if a visual node exists under root and is currently visible.
Settings concerning debugging GridBuilder plugin issues
State of manipulation actions (move, demolish, etc).
Gets the separator string for the given enum value.[br][br] [code]p_seperator_enum[/code]: [i]int[/i] - The separator enum value from project settings
Validates that all required dependencies are properly set. Returns list of validation issue messages (empty if valid). Fail-fast abstract.
Base category for a Node class that serves as an dependency injectable child of a GBSystem
Recursively search for Camera2D in a node tree
Overlay object for validating tile placement rules on an individual tile or region.[br][br] [code]rule_check_indicator[/code]: [i]PackedScene[/i] - Template scene for visual placement validation feedback
Checks that the property values of each property name are not null. Returns an array of issues found.[br][br] [code]p_obj[/code]: [i]Object[/i] - Object to validate properties on[br] [code]p_property_names[/code]: [i]Array[String][/i] - Array of property names to check for null values
Settings for highlighting targets in the game world during building, move, demolish, etc. This includes colors for valid and invalid moves, as well as reset colors
GridBuilding class for GridBuilding
Analyzes a scene for grid building system components and configuration issues
NOTE: Script now expected to...
Validates button configuration and dependencies....
Handles mode change events and outputs to action log if enabled
Make sure each action is set in the input map
Gets diagnostic information about a folder's contents
Limit the desired tile so...
Runtime validation for game startup...
Helper to get the center of the camera's viewport rectangle
[b]Circle tile pruning[/b] Generic pruning...
Internal helper to get debug settings without logging (for logger initialization)
Lazy inits sub resources that have not been defined in the Godot inspector.
Highly recommended to call this...
Validates editor configuration before nodes...
Injectable control for display grid building related information for the owning object.
Optional component for changing the cursors when the grid builder mode state changes.
Get any runtime issues detected for this resource.
Safe wrapper for getting tile...
Convert ProjectionMethod enum to string
Base class for a node that is attached to gameplay objects for grid building operations
Fallback for square tiles, uses bounding box intersection
Checks if a tile is...
Helper function to set a...
Helper method to manually inject...
Creates and injects any RefCounted...
[b]Private helper: Report warnings through direct print or push_warning.[/b][br]
Validate setup and return a list of issues with the current object
Change the level of the GBDebugSettings to change how much information is logged
[code]p_target[/code]: [i]Node[/i] - The node to re-enable
Holds the last mouse input...
Abstract method to resolve dependencies...
Use this base for Node2D-derived...
Gets a readable display name...
Validates that all required dependencies...
Validates the runtime configuration after...
Convert an arbitrary direction vector...
Get a string identifying name for the resource for debugging purposes
Require Camera2D node present in the viewport for positioning utilities
Returns true if a visual node exists under root and is currently visible.
Settings concerning debugging GridBuilder plugin issues
State of manipulation actions (move, demolish, etc).
Gets the separator string for...
Validates that all required dependencies...
Base category for a Node class that serves as an dependency injectable child of a GBSystem
Recursively search for Camera2D in a node tree
Overlay object for validating tile...
Checks that the property values...
Settings for highlighting targets in...
GridBuilding class for GridBuilding
Analyzes a scene for grid building system components and configuration issues