Skip to content

BoardPlacementGrid

Divided by Zer0 edited this page Mar 9, 2022 · 6 revisions

BoardPlacementGrid

Extends: Control

Description

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

Property Descriptions

highlight

export var highlight = "0,0.52,1.3,1.3"

Set the highlight colour for all contained BoardPlacementSlot slots

auto_extend

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)

card_size

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

card_play_scale

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

name_label

var name_label

Sets a custom label for this grid

Method Descriptions

get_highlighted_slot

func get_highlighted_slot() -> BoardPlacementSlot

If a BoardPlacementSlot object child in this container is highlighted Returns the object. Else returns null

get_slot

func get_slot(idx: int) -> BoardPlacementSlot

Returns the slot at the specified index.

add_slot

func add_slot() -> BoardPlacementSlot

Adds new placement slot to the grid. Returns the slot object

find_available_slot

func find_available_slot() -> BoardPlacementSlot

Returns a slot that is not currently occupied by a card

get_all_slots

func get_all_slots() -> Array

Returns an array containing all the BoardPlacementSlot nodes

get_slot_count

func get_slot_count() -> int

Returns the amount of BoardPlacementSlot contained.

get_available_slots

func get_available_slots() -> Array

Returns an array with all slots not occupied by a card

count_available_slots

func count_available_slots() -> int

Returns the count of all available slots

Clone this wiki locally