Note
HELP WANTED!
Most class reference pages are not fully covered yet! If you have more information, please consider Contributing!
ActionUIData
Inherits: Control < CanvasItem < Node < Object
No description provided.
Overview
Properties Index
|
||
|
||
|
||
|
||
|
Methods Index
_ready() |
|
get_data() |
|
init() |
|
on_opponent_button_selected(button: Node) |
|
set_facing(facing: int) |
Signals
data_changed() 🔗
Emitted when the player changes selections made in this ^ActionUIData scene. See ^_ready()
The game listens to this signal and restarts the prediction when it is emitted.
Property Descriptions
Direct reference to the Action Menu
Vector2 display_offset = Vector2() 🔗
Unused.
Unused, use ^set_facing() and ^get_facing() instead
Direct reference to the ^Fighter object this ^ActionUIData belongs to.
CharacterState state = null 🔗
No description provided.
Method Descriptions
Called when this node and it’s child nodes are “ready”. See ^Node._ready() . Connects the data_changed signal of all child nodes to this nodes ^data_changed() signal.
Called by the Action Menu at the start of each turn, and when another state is selected that isn’t the one that owns this ^ActionUIData .
The method is empty by default and should be overridden to have any effect.
Dictionary get_data() 🔗
Called by the Action Menu when the player has locked in their selection, or when the prediction resets after ^data_changed() is emitted.
The returned ^Dictionary is provided to the state that owns this ^ActionUIData and is available in it’s script via it’s ^StateInterface.data variable during the states execution.
By default, depending on how many child nodes this ^ActionUIData contains, the data returned is either the data from the child nodes ^get_data() function directly if there is only one child, or if there are two or more children it will be a ^Dictionary of each child nodes ^get_data() values organized by child nodes names.
# Example for one 8Way child
data["x"] # or data.x
data["y"] # or data.y
# Example for an 8Way named "Direction" and a Slider named "Distance"
data["Direction"]["x"] # or data.Direction.x\ndata["Direction"]["y"] # or data.Direction.y
data["Distance"]["x"] # or data.Distance.x
Returns the value of the ^get_facing() function of the first child node that has it.
Calls the ^init() function of all child nodes that have it.
Called by the Action Menu when the player selects the state that owns this ^ActionUIData .
The method is empty by default and should be overridden to have any effect.
No description provided.
void on_opponent_button_selected(button: Node) 🔗
Called by the Action Menu when the player selects a state for the opponent prediction, while the state that owns this ^ActionUIData is selected. button is a direct reference to the ^ActionUIData selected.
The method is empty by default and should be overridden to have any effect.
void set_facing(facing: int) 🔗
Called by the Action Menu at the start of each turn, providing the facing int (1 if right, -1 if left) of the ^Fighter . Calls the ^set_facing() function of all child nodes that have it.