Class Placeable
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
Object that can be placed into the game world by instancing the packed_scene.
class Placeable extends GBResource
Placeable
Fields
UID
const UID = "uid"
FILE_PATH
const FILE_PATH = "file_path"
Properties
display_name
Display name for in-game reading.
@export var display_name: StringName
icon
Texture icon for UI elements.
@export var icon: Texture2D
packed_scene
Scene to instance when placed.
@export var packed_scene: PackedScene
tags
Category tags for grouping placeables.
@export var tags: Array[CategoricalTag]
placement_rules
Placement rules specific to this placeable. If [member ignore_base_rules] is [code]false[/code], these rules are combined with base rules from [member GBSettings.placement_rules].
@export var placement_rules: Array[PlacementRule] = []
ignore_base_rules
When [code]true[/code], skips base placement rules from [member GBSettings.placement_rules] and uses ONLY the rules defined in [member placement_rules].\n\nUse cases: - [code]false[/code] (default): Inherit common rules + add object-specific rules - [code]true[/code]: Completely custom validation (e.g., special objects with unique placement logic)
@export var ignore_base_rules = false
dictionary
var dictionary = {
placeable
var placeable: Placeable
uid_str
var uid_str: String = p_load_data[Names.UID]
uid_int
var uid_int: int = ResourceUID.text_to_id(uid_str)
file_path
var file_path = p_load_data[Names.FILE_PATH]
issues
var issues: Array[String] = []
valid_rule_count
var valid_rule_count = 0
issues
var issues: Array[String] = []
all_passing
var all_passing = true
valid_rule_count
var valid_rule_count = 0
Methods
get_load_data
func get_load_data(p_include_uid : bool) -> Dictionary:
Parameters
p_include_uid
Returns
load_resource
static func load_resource(p_load_data : Dictionary) -> Placeable:
Parameters
p_load_data
Returns
get_packed_root_name
func get_packed_root_name() -> StringName:
Returns
get_editor_issues
func get_editor_issues() -> Array[String]:
Returns
get_runtime_issues
func get_runtime_issues() -> Array[String]: