state display
This commit is contained in:
parent
6949893fea
commit
5d410a02fb
3 changed files with 27 additions and 15 deletions
|
|
@ -23,7 +23,7 @@ var p2Points: int = 0
|
|||
var Turn: int = 0
|
||||
@onready var turnIndicator: ColorRect = $TurnIndicator
|
||||
@onready var p1String: RichTextLabel = $Player1Points
|
||||
@onready var p2String: RichTextLabel = $Player2Points
|
||||
@onready var p2String: RichTextLabel = $Player2Points
|
||||
@onready var deckManager: DeckManager
|
||||
@onready var cardDisplay: CardDisplay
|
||||
@onready var cardPreview: CardPreview
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class_name StateMachine extends Node
|
|||
|
||||
@onready var parent = get_parent()
|
||||
var previouseState = null
|
||||
@onready var stateString: RichTextLabel = owner.get_node("StateLabel")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -37,4 +38,5 @@ func transitionToNextState(targetStatePath: String, data: Dictionary = {}) -> vo
|
|||
previouseState = state.name
|
||||
state.exit()
|
||||
state = get_node(targetStatePath)
|
||||
stateString.text = targetStatePath;
|
||||
state.enter(previouseState, data)
|
||||
|
|
|
|||
38
board.tscn
38
board.tscn
|
|
@ -22,6 +22,8 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -104.0
|
||||
offset_bottom = -5.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_fkb2r")
|
||||
|
|
@ -40,9 +42,10 @@ layout_mode = 1
|
|||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -50.0
|
||||
offset_top = 50.0
|
||||
offset_bottom = 89.0
|
||||
offset_left = 51.0
|
||||
offset_top = 48.0
|
||||
offset_right = 101.0
|
||||
offset_bottom = 87.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="Player2Points" type="RichTextLabel" parent="."]
|
||||
|
|
@ -50,9 +53,10 @@ layout_mode = 1
|
|||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -48.0
|
||||
offset_top = 100.0
|
||||
offset_bottom = 140.0
|
||||
offset_left = 54.0
|
||||
offset_top = 96.0
|
||||
offset_right = 102.0
|
||||
offset_bottom = 136.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="TurnIndicator" type="ColorRect" parent="."]
|
||||
|
|
@ -61,16 +65,22 @@ layout_mode = 1
|
|||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -50.0
|
||||
offset_bottom = 50.0
|
||||
offset_left = 52.0
|
||||
offset_top = -2.0
|
||||
offset_right = 102.0
|
||||
offset_bottom = 48.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1062.0
|
||||
offset_top = 65.0
|
||||
offset_right = 1142.0
|
||||
offset_bottom = 104.0
|
||||
[node name="StateLabel" type="RichTextLabel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -78.0
|
||||
offset_top = 1.0
|
||||
offset_right = 51.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="Hand" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue