PlaceableView
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
UI view for a single placeable used in selection lists.
Source File: addons/grid_building/ui/placeable/single/placeable_view.gd
Extends: PanelContainer
Signals
Signal:
placeable_selected(placeable: Placeable)Emitted when the user clicks on this placeable view to select it.
placeableThe placeable object associated with this view.
Exported Properties
Property:
fixed_view_height : int = 48Fixed 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.
Property:
fixed_icon_size : int = 40Fixed 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.
Property:
default_text: String = "None"Default text to display when no placeable is assigned.
Default: “None” for a clean, game-friendly placeholder.
Property:
placeable: [Placeable](./placeable/):
Private Properties
Property:
_placeable: [Placeable](./placeable/)(private)The placeable object displayed by this view.
When set, updates the icon and label to reflect the placeable’s display name and icon texture.
Property:
_icon_rect: TextureRect(private) - Icon texture display node (child of HBox)Property:
_label: Label(private) - Label display node for placeable name (child of HBox)Property:
_ui_interaction: [PlaceableUIInteraction](./placeable-ui-interaction/)(private) - Handles click/hover interactions for this view
Private Methods
_ready
Flags: private
Called when the node enters the scene tree.
Initializes the view by wiring child nodes, setting up interaction, and enforcing sizing.
_init_interaction
Flags: private
Initializes UI interaction handling for click and hover events.
_on_clicked
Flags: private
Called when the user clicks on this view. Emits placeable_selected.
_wire_nodes
Flags: private
Wires up references to child nodes (Icon TextureRect and Label).
_update_view
Flags: private
Updates the view’s icon and label to reflect the current placeable.
Shows default text if placeable is null.
_enforce_view_height
Flags: private
Enforces fixed height for consistent sizing when fixed_view_height > 0.
When disabled (0), allows the view to size naturally based on content.
_enforce_icon_size
Flags: private
Enforces fixed icon size for consistent icon dimensions when 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.