PlaceableView
Summary
Section titled “Summary”Emitted when the user clicks on this placeable view to select it.
placeable
: The placeable object associated with this view.
Signals
Section titled “Signals”signal placeable_selected( placeable: Placeable )
Emitted when the user clicks on this placeable view to select it.
placeable
: The placeable object associated with this view.
Properties
Section titled “Properties”fixed_view_height: int = 48
Fixed height for placeable views to maintain consistent sizing.
When set to a positive value, enforces a fixed height regardless of content.
When set to 0, height enforcement is disabled and the view will size naturally.
Default: 48 pixels to match template standard sizing.
fixed_icon_size: int = 40
Fixed icon size for consistent icon dimensions across all placeable views.
When set to a positive value, enforces both width and height of icon TextureRect.
When set to 0, icon sizing is not enforced and will use scene file settings.
Default: 40 pixels to match standard icon sizing.
placeable: Placeable:
The placeable object displayed by this view.
When set, updates the icon and label to reflect the placeable’s display name and icon texture.
Methods
Section titled “Methods”func _ready( )
Icon texture display node (child of HBox) Label display node for placeable name (child of HBox) Handles click/hover interactions for this view
Called when the node enters the scene tree.
Initializes the view by wiring child nodes, setting up interaction, and enforcing sizing.
func _init_interaction( )
Initializes UI interaction handling for click and hover events.
func _on_clicked( )
Called when the user clicks on this view. Emits [signal placeable_selected].
func _wire_nodes( )
Wires up references to child nodes (Icon TextureRect and Label).
func _update_view( )
Updates the view’s icon and label to reflect the current placeable.
Clears the view if placeable is null.
func _enforce_view_height( ) -> void
Enforces fixed height for consistent sizing when [member fixed_view_height] > 0.
When disabled (0), allows the view to size naturally based on content.
func _enforce_icon_size( ) -> void
Enforces fixed icon size for consistent icon dimensions when [member fixed_icon_size] > 0.
Constrains icon to a square boundary (fixed_icon_size x fixed_icon_size) while maintaining
aspect ratio. The larger dimension is scaled to fit fixed_icon_size, and the smaller dimension
scales proportionally. Icon is centered within the bounds.
When disabled (0), icon sizing is not enforced and will use scene file settings.
Source
Section titled “Source”addons/grid_building/ui/placeable/single/placeable_view.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.