-
-
Notifications
You must be signed in to change notification settings - Fork 105
BoardPlacementGrid
Extends: Control
Creates a GridContainer in which cards can be placed organized next to each other.
To use this scene properly, create an inherited scene, then add as many instanced BoardPlacementSlots as you need this grid to hold
Adjust its highlight colour and the amount of columns it should have as well
The BoardPlacementSlots will adjust to card_size on runtime, but If you want to visually see on the editor your result
export var highlight = "0,0.52,1.3,1.3"
Set the highlight colour for all contained BoardPlacementSlot slots
export var auto_extend: bool = false
Set the highlight colour for all contained BoardPlacementSlot slots If set to true, the grid will automatically add more slots when find_available_slot() is used and there's no more available slots (only useful when using the ScriptingEngine)
export var card_size: Vector2 = "(150, 240)"
Set the highlight colour for all contained BoardPlacementSlot slots If set to true, the grid will automatically add more slots when find_available_slot() is used and there's no more available slots (only useful when using the ScriptingEngine) Used to adjust the grid according to the card size that will be put into it. This size should match the
export var card_play_scale: float = 0.8
Set the highlight colour for all contained BoardPlacementSlot slots If set to true, the grid will automatically add more slots when find_available_slot() is used and there's no more available slots (only useful when using the ScriptingEngine) Used to adjust the grid according to the card size that will be put into it. This size should match the
var name_label
Sets a custom label for this grid
func get_highlighted_slot() -> BoardPlacementSlot
If a BoardPlacementSlot object child in this container is highlighted Returns the object. Else returns null
func get_slot(idx: int) -> BoardPlacementSlot
Returns the slot at the specified index.
func add_slot() -> BoardPlacementSlot
Adds new placement slot to the grid. Returns the slot object
func find_available_slot() -> BoardPlacementSlot
Returns a slot that is not currently occupied by a card
func get_all_slots() -> Array
Returns an array containing all the BoardPlacementSlot nodes
func get_slot_count() -> int
Returns the amount of BoardPlacementSlot contained.
func get_available_slots() -> Array
Returns an array with all slots not occupied by a card
func count_available_slots() -> int
Returns the count of all available slots