Skip to content

Class

ObjectDragShapePreview

Generated GDScript class reference for GridPlacement.ObjectDragShapePreview.

Status
Current
Version
v6.1.0
Source updated
2026-09-24
Generated on
2026-09-23

Live shape indicator for object multi-cell drags (LINE, RECTANGLE_FILL, RECTANGLE_OUTLINE). Terrain brushes already ghost the full pending shape while dragging (TerrainPreview); object drags previously showed only the single cursor ghost, so the area a release stamps was invisible. This node draws the pending shape from the session brush state's drag start to the live cursor cell: the exact generated cell path for LINE, a map-aligned polygon for rectangle shapes, and translucent fill only for RECTANGLE_FILL. On top of the span geometry, the overlay marks the ordered-simulation candidates: each shape cell, in commit order, whose footprint rect is anchored on mapped tile data and free of committed records plus already-accepted cells. Only these cells get placement markers, so a multi-cell drag shows the sparse subset it will actually stamp. Full rules still gate each commit, so commit results are always a subset of the preview — never more. Wiring: place one under World next to TerrainPreview. The host binder calls resolve_placement_runtime(host, session); the node then polls the session brush lifecycle every physics frame and hides itself whenever no object drag is active, so release, cancel, mode-exit, and session paths need no explicit teardown calls. 2D GRID TileMapLayer sessions only: without a target map (3D sessions) the node stays hidden.

Source: addons/grid_placement/systems/building/object_drag_shape_preview.gd

Syntax

class ObjectDragShapePreview extends PlacementNode2D

Members

NameKindSummary
PREVIEW_GROUPFieldScene-tree group so the host or tools can refresh all shape previews.
FALLBACK_OUTLINEFieldFallback outline color when no highlight settings resolve.
FILL_ALPHAFieldFill alpha applied over the resolved outline color.
SIM_REFRESH_INTERVAL_TICKSField
resolve_placement_dependenciesMethod
resolve_placement_runtimeMethod
request_refreshMethod
update_previewMethod
get_last_geometryMethod
is_shape_visibleMethod
emptyProperty
serviceProperty
entryProperty
capProperty
coordinatorProperty
placement_budgetProperty
preview_settingsProperty
tile_sizeProperty
placement_capProperty
rotationProperty
previewProperty
placed_countProperty
statesProperty
tickProperty
keyProperty
cellsProperty
resultProperty
geometry_for_cellsMethod
noneProperty
line_cellsProperty
line_pointsProperty
min_cellProperty
max_cellProperty
basis_xProperty
basis_yProperty
half_xProperty
half_yProperty
top_leftProperty
top_rightProperty
bottom_rightProperty
bottom_leftProperty
outlineProperty
boundsProperty