Class PlaceableView
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
UI view for a single placeable used in selection lists.\n\nRenders a placeable's icon and display name in a horizontal layout with configurable sizing and padding. Emits [signal placeable_selected] when the user clicks on the view.\n\n[b]Usage:[/b] [codeblock] var view = PlaceableView.new() view.placeable = my_placeable view.fixed_view_height = 48 view.fixed_icon_size = 40 view.placeable_selected.connect(_on_placeable_selected) [/codeblock]
class PlaceableView extends PanelContainer
Properties
fixed_view_height
Fixed height for placeable views to maintain consistent sizing.[br][br] When set to a positive value, enforces a fixed height regardless of content.[br] When set to 0, height enforcement is disabled and the view will size naturally.[br] Default: 48 pixels to match template standard sizing.
@export var fixed_view_height: int = 48
fixed_icon_size
Fixed icon size for consistent icon dimensions across all placeable views.[br][br] When set to a positive value, enforces both width and height of icon TextureRect.[br] When set to 0, icon sizing is not enforced and will use scene file settings.[br] Default: 40 pixels to match standard icon sizing.
@export var fixed_icon_size: int = 40
placeable
The placeable object displayed by this view.[br][br] When set, updates the icon and label to reflect the placeable's display name and icon texture.
@export var placeable: Placeable:
icon_vector
var icon_vector = Vector2(fixed_icon_size, fixed_icon_size)
Events
placeable_selected
Emitted when the user clicks on this placeable view to select it. [br][br] [param placeable] The placeable object associated with this view.
signal placeable_selected(placeable: Placeable)