Class PlacementProfile
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
Placement behavior profile applied to placeables via [member ScenePlacementEntry.profiles].\n\nA profile carries placement rules, tool restrictions, and placement overrides that layer onto all placeables sharing the tag. Profiles are resolved in the three-tier rule order: base → profile → placeable.\n\nProfiles replace the deprecated [CategoricalTag] class. See the 6.0 migration guide for the rename path.
class PlacementProfile extends Resource
Properties
description
Multiline description with BBCode support for UI display.
@export_multiline var description: String
display_name
Display name for UI and gameplay.
@export var display_name: StringName
icon
Small image representing the profile in UI elements.
@export var icon: Texture2D
placement_rules
Placement rules that apply to all placeables with this profile. These sit between base config rules and per-placeable rules in the three-tier resolution order: base → profile → placeable.
@export var placement_rules: Array[PlacementRule] = []
ignore_base_rules
When [code]true[/code], placeables with this profile ignore base config and profile placement rules, using only per-placeable [member ScenePlacementEntry.placement_rules]. Any profile on a placeable can opt it out of base rules; this is OR-ed with [member ScenePlacementEntry.ignore_base_rules].
@export var ignore_base_rules: bool = false
supported_object_tools
Object tools supported by this profile. Defaults to [enum SINGLE] only. Multiple profiles on a placeable merge their tool lists; the placeable can then override with [member ScenePlacementEntry.tool_override_mode].
@export var supported_object_tools: Array[PlacementEnums.ObjectTool] = [PlacementEnums.ObjectTool.SINGLE]
disable_grid_snap
When [code]true[/code], placeables with this profile skip grid snapping during placement. The instance is placed at the exact cursor/world position instead of snapping to tile centers. Use for free-form doodads and decorations. Any profile on a placeable can disable snapping; the first [code]true[/code] wins.
@export var disable_grid_snap: bool = false
placed_parent_name
When non-empty, placeables with this profile are parented to a child of [member PlacementState.placed_parent] with this name instead of the default parent. The node is created automatically if it doesn't exist. When multiple profiles specify a parent name, the first non-empty value wins. Leave empty to use the default [member PlacementState.placed_parent].
@export var placed_parent_name: String = ""
rules
var rules: Array[PlacementRule] = []
tools
var tools: Array = [PlacementEnums.ObjectTool.SINGLE]
Methods
resolve_category_rules
static func resolve_category_rules(p_profiles: Array) -> Array[PlacementRule]:
Parameters
p_profiles
Returns
collect_supported_tools
static func collect_supported_tools(p_profiles: Array) -> Array:
Parameters
p_profiles