9.24下午
This commit is contained in:
parent
eb9933afbd
commit
f0a6e44f61
@ -15,10 +15,10 @@ func launch():
|
||||
state_now.enter_state(1)
|
||||
set_process(true)
|
||||
func _process(delta):
|
||||
if state_now:
|
||||
if state_now!=null:
|
||||
state_now.update_state(delta)
|
||||
func _physics_process(delta):
|
||||
if state_now:
|
||||
if state_now!=null:
|
||||
state_now.update_state_phy(delta)
|
||||
##判断n节点是否在状态机节点所拥有的状态中
|
||||
func is_in_list(n)->bool:
|
||||
|
@ -49,3 +49,8 @@ mouse_down={
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(300, 12),"global_position":Vector2(309, 58),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
mouse_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(242, 15),"global_position":Vector2(251, 61),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
extends Control
|
||||
class_name Card
|
||||
@onready var state_machine: StateMachine = $state_machine
|
||||
@onready var fight_card: TextureRect = $fight_card
|
||||
|
||||
var scale_multiple:float=1.1
|
||||
func _ready() -> void:
|
||||
state_machine.launch()
|
||||
|
||||
func _on_fight_card_mouse_entered() -> void:
|
||||
state_machine.send_message("mouse_enter")
|
||||
@ -12,15 +15,42 @@ func _on_fight_card_mouse_exited() -> void:
|
||||
|
||||
state_machine.send_message("mouse_exit")
|
||||
pass # Replace with function body.
|
||||
|
||||
func up():
|
||||
var data:Dictionary
|
||||
func set_data(id:String):
|
||||
|
||||
|
||||
pass
|
||||
var last_move_tween:Tween
|
||||
func move_to(from_pos:Vector2,to_pos:Vector2,time:float=0.5):
|
||||
if last_move_tween!=null:
|
||||
last_move_tween.kill()
|
||||
self.position=from_pos
|
||||
var tween=create_tween()
|
||||
tween.set_trans(Tween.TRANS_QUAD)
|
||||
tween.tween_property(self,"position",to_pos,time)
|
||||
tween.tween_callback(move_finished)
|
||||
|
||||
last_move_tween=tween
|
||||
func move_finished():
|
||||
state_machine.send_message("move_finished")
|
||||
pass
|
||||
func up():
|
||||
z_index=1
|
||||
scale_to(scale_multiple)
|
||||
|
||||
func down():
|
||||
z_index=0
|
||||
scale_to(1)
|
||||
var last_scale_tween:Tween
|
||||
func scale_to(sc:float):
|
||||
if last_scale_tween!=null:
|
||||
last_scale_tween.kill()
|
||||
last_scale_tween=get_tree().create_tween()
|
||||
last_scale_tween=create_tween()
|
||||
last_scale_tween.tween_property(fight_card,"scale",Vector2(sc,sc),0.1)
|
||||
|
||||
func get_machine()->CardMachine:
|
||||
return get_parent()
|
||||
func get_self_index_position():
|
||||
return get_machine().get_index_position(get_index())
|
||||
|
||||
func request_resize():
|
||||
state_machine.send_message("resize")
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://8a2mwnnmnecl"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://8a2mwnnmnecl"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://chowelwcfnsxs" path="res://scene/fight_card.tscn" id="1_nmkht"]
|
||||
[ext_resource type="Script" path="res://scene/card.gd" id="1_wc0x3"]
|
||||
@ -7,21 +7,29 @@
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/idle.gd" id="4_p2uoy"]
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/focus.gd" id="6_3e38c"]
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/selected.gd" id="7_ugr71"]
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/selected_back.gd" id="8_adb0l"]
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/queue.gd" id="8_y4vrd"]
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/exe.gd" id="9_40m88"]
|
||||
|
||||
[node name="card" type="Control"]
|
||||
layout_direction = 1
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_wc0x3")
|
||||
|
||||
[node name="fight_card" parent="." instance=ExtResource("1_nmkht")]
|
||||
layout_direction = 1
|
||||
layout_mode = 0
|
||||
offset_left = -93.0
|
||||
offset_top = -127.0
|
||||
offset_right = 96.0
|
||||
offset_bottom = 123.0
|
||||
pivot_offset = Vector2(94, 125)
|
||||
metadata/_edit_pinned_properties_ = [&"layout_mode", &"pivot_offset", &"layout_direction"]
|
||||
|
||||
[node name="state_machine" type="Node" parent="."]
|
||||
script = ExtResource("3_k5t40")
|
||||
init_state = NodePath("idle")
|
||||
init_state = NodePath("getting")
|
||||
owner_player = NodePath("..")
|
||||
|
||||
[node name="getting" type="Node" parent="state_machine"]
|
||||
@ -36,6 +44,9 @@ script = ExtResource("6_3e38c")
|
||||
[node name="selected" type="Node" parent="state_machine"]
|
||||
script = ExtResource("7_ugr71")
|
||||
|
||||
[node name="selected_back" type="Node" parent="state_machine"]
|
||||
script = ExtResource("8_adb0l")
|
||||
|
||||
[node name="queue" type="Node" parent="state_machine"]
|
||||
script = ExtResource("8_y4vrd")
|
||||
|
||||
|
62
scene/card_state_machine/arrow.gd
Normal file
62
scene/card_state_machine/arrow.gd
Normal file
@ -0,0 +1,62 @@
|
||||
extends Control
|
||||
class_name card_arrow
|
||||
##用于贝塞尔曲线选择目标的线图片
|
||||
@export var texture_circle:Texture2D
|
||||
##用于贝塞尔曲线选择目标的箭头图片
|
||||
@export var texture_arrow:Texture2D
|
||||
##贝塞尔曲线选择目标的线密度
|
||||
@export var texture_num:int=5
|
||||
##贝塞尔箭头初始旋转因子(弧度制度)
|
||||
@export var arrowImageRotate:float=PI/2
|
||||
##箭头图片容器场景
|
||||
@export var arrowImageScene:PackedScene
|
||||
##是否开启
|
||||
@export var is_start:bool=false
|
||||
@export_group("缩放")
|
||||
##用来决定arrow节点缩放曲线的curve
|
||||
@export var curve:Curve
|
||||
##缩放最大系数
|
||||
@export var max_scale:float=2
|
||||
##图片节点队列
|
||||
var texture_array:Array[arrowImage]=[]
|
||||
func _ready():
|
||||
curve.bake()
|
||||
for i in range(texture_num):
|
||||
var new_texture=arrowImageScene.instantiate()
|
||||
self.add_child(new_texture)
|
||||
texture_array.append(new_texture)
|
||||
new_texture.set_image(texture_circle,2)
|
||||
new_texture.hide()
|
||||
texture_array[texture_num-1].set_image(texture_arrow,2)
|
||||
func replace_texture():
|
||||
var mouse_pos=(get_viewport().get_mouse_position()-self.global_position)
|
||||
texture_array[0].rotation=texture_array[1].rotation
|
||||
for i in range(1,texture_array.size()):
|
||||
var t=logWithBase(float(i)/(texture_array.size()-1)+1,2)
|
||||
var res=get_bezier_position(self.position,mouse_pos,t)
|
||||
texture_array[i].position=res[0]-self.position
|
||||
texture_array[i].rotation=res[1]-self.rotation+arrowImageRotate
|
||||
var scal=curve.sample(float(i+1)/texture_array.size())*max_scale
|
||||
texture_array[i].scale=Vector2(scal,scal)
|
||||
func _process(delta):
|
||||
if is_start:
|
||||
replace_texture()
|
||||
|
||||
|
||||
##贝塞尔曲线
|
||||
func get_bezier_position(p:Vector2,q:Vector2,scale:float):
|
||||
var p1=p+(q-p)*Vector2(-0.3,0.8)
|
||||
var p2=p+(q-p)*Vector2(0.1,1.4)
|
||||
return [(1-scale)**3*p+3*(1-scale)**2*scale*p1+3*(1-scale)*scale**2*p2+scale**3*q,
|
||||
((3*q-9*p2+9*p1-3*p)*scale**2+(6*p2-12*p1+6*p)*scale+3*p1-3*p).angle()]
|
||||
pass
|
||||
func logWithBase(value, base)->float:
|
||||
return log(value) / log(base)
|
||||
func start():
|
||||
for i in texture_array:
|
||||
i.show()
|
||||
is_start=true
|
||||
func stop():
|
||||
for i in texture_array:
|
||||
i.hide()
|
||||
is_start=false
|
10
scene/card_state_machine/arrow.tscn
Normal file
10
scene/card_state_machine/arrow.tscn
Normal file
@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://c7vtcaeg4nkbu"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/arrow.gd" id="1_oqukl"]
|
||||
|
||||
[node name="arrow" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("1_oqukl")
|
8
scene/card_state_machine/arrowImg.gd
Normal file
8
scene/card_state_machine/arrowImg.gd
Normal file
@ -0,0 +1,8 @@
|
||||
extends Control
|
||||
|
||||
class_name arrowImage
|
||||
|
||||
|
||||
func set_image(texture:Texture2D,scaleto:float):
|
||||
$Sprite2D.set_texture(texture)
|
||||
$Sprite2D.scale=Vector2(scaleto,scaleto)
|
12
scene/card_state_machine/arrowImg.tscn
Normal file
12
scene/card_state_machine/arrowImg.tscn
Normal file
@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dg27pietgq7qd"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/arrowImg.gd" id="1_bqs37"]
|
||||
[ext_resource type="Texture2D" uid="uid://be3n1b7s2o4mm" path="res://icon.svg" id="2_ksud6"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_bqs37")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_ksud6")
|
25
scene/card_state_machine/card_machine.gd
Normal file
25
scene/card_state_machine/card_machine.gd
Normal file
@ -0,0 +1,25 @@
|
||||
extends Control
|
||||
class_name CardMachine
|
||||
const CARD = preload("res://scene/card.tscn")
|
||||
var distance:float=100
|
||||
var card_arr:Array[Card]=[]
|
||||
func get_index_position(index:int)->Vector2:
|
||||
var center=size/2
|
||||
var left=center-Vector2(distance*card_arr.size()/2,0)
|
||||
var rand_y=randf_range(-10,10)
|
||||
return left+Vector2(distance*index,rand_y)
|
||||
func _ready() -> void:
|
||||
add_card("xxx",4)
|
||||
|
||||
func get_put_pos():
|
||||
return size/2
|
||||
|
||||
func add_card(card_id:String,num:int):
|
||||
var data=Global.get_card_data(card_id)
|
||||
for i in num:
|
||||
var new_card=CARD.instantiate()
|
||||
add_child(new_card)
|
||||
card_arr.append(new_card)
|
||||
for j in card_arr:
|
||||
j.request_resize()
|
||||
pass
|
13
scene/card_state_machine/card_machine.tscn
Normal file
13
scene/card_state_machine/card_machine.tscn
Normal file
@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b6t1mn3dd73ox"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/card_state_machine/card_machine.gd" id="1_gptwc"]
|
||||
|
||||
[node name="card_machine" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_gptwc")
|
@ -1,11 +1,24 @@
|
||||
extends State
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
func enter_state(n):
|
||||
get_player().up()
|
||||
pass
|
||||
func update_state(delta):
|
||||
if Input.is_action_just_pressed("mouse_left"):
|
||||
print("change")
|
||||
change_to_state("selected")
|
||||
return
|
||||
func update_state_phy(delta):
|
||||
pass
|
||||
func exit_state():
|
||||
get_player().down()
|
||||
pass
|
||||
|
||||
func time_out():
|
||||
pass
|
||||
func process_message(type:String,n):
|
||||
match type:
|
||||
"mouse_exit":
|
||||
change_to_state("idle")
|
||||
|
||||
pass
|
||||
|
@ -1,11 +1,26 @@
|
||||
extends State
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
func enter_state(n):
|
||||
var player:Card=get_player() as Card
|
||||
var target_position=player.get_self_index_position()
|
||||
player.move_to(player.position,target_position)
|
||||
func update_state(delta):
|
||||
pass
|
||||
func update_state_phy(delta):
|
||||
pass
|
||||
func exit_state():
|
||||
pass
|
||||
|
||||
func time_out():
|
||||
pass
|
||||
func process_message(type:String,n):
|
||||
match type:
|
||||
"move_finished":
|
||||
change_to_state("idle")
|
||||
"resize":
|
||||
var player:Card=get_player() as Card
|
||||
var target_position=player.get_self_index_position()
|
||||
player.move_to(player.position,target_position)
|
||||
|
||||
pass
|
||||
pass
|
||||
|
@ -11,6 +11,13 @@ func exit_state():
|
||||
func time_out():
|
||||
pass
|
||||
func process_message(type:String,n):
|
||||
|
||||
|
||||
match type:
|
||||
"mouse_enter":
|
||||
change_to_state("focus")
|
||||
"resize":
|
||||
var player:Card=get_player() as Card
|
||||
var target_position=player.get_self_index_position()
|
||||
player.move_to(player.position,target_position)
|
||||
|
||||
pass
|
||||
pass
|
||||
|
@ -1 +1,25 @@
|
||||
extends State
|
||||
func enter_state(n):
|
||||
get_player().up()
|
||||
pass
|
||||
func update_state(delta):
|
||||
get_player().position=get_player().get_parent().get_local_mouse_position()
|
||||
if Input.is_action_just_released("mouse_left"):
|
||||
change_to_state("selected_back")
|
||||
return
|
||||
if Input.is_action_just_pressed("mouse_right"):
|
||||
change_to_state("selected_back")
|
||||
return
|
||||
pass
|
||||
func update_state_phy(delta):
|
||||
pass
|
||||
func exit_state():
|
||||
|
||||
pass
|
||||
|
||||
func time_out():
|
||||
pass
|
||||
func process_message(type:String,n):
|
||||
|
||||
|
||||
pass
|
||||
|
28
scene/card_state_machine/selected_back.gd
Normal file
28
scene/card_state_machine/selected_back.gd
Normal file
@ -0,0 +1,28 @@
|
||||
extends State
|
||||
func enter_state(n):
|
||||
get_player().down()
|
||||
var player:Card=get_player() as Card
|
||||
var target_position=player.get_self_index_position()
|
||||
player.move_to(player.position,target_position)
|
||||
pass
|
||||
func update_state(delta):
|
||||
get_player().position=get_player().get_parent().get_local_mouse_position()
|
||||
if Input.is_action_just_released("mouse_left"):
|
||||
change_to_state("focus")
|
||||
return
|
||||
|
||||
pass
|
||||
func update_state_phy(delta):
|
||||
pass
|
||||
func exit_state():
|
||||
|
||||
pass
|
||||
|
||||
func time_out():
|
||||
pass
|
||||
func process_message(type:String,n):
|
||||
match type:
|
||||
"move_finished":
|
||||
change_to_state("idle")
|
||||
return
|
||||
pass
|
110
scene/figF43C.tmp
Normal file
110
scene/figF43C.tmp
Normal file
@ -0,0 +1,110 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://sn3v7t7xjr1o"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/fight.gd" id="1_1e3ie"]
|
||||
[ext_resource type="Texture2D" uid="uid://b1wfklbrwhh3y" path="res://res/ui/ui_025_adventure_mode/tuceng349.png" id="1_08haj"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc1ldr8rx3te3" path="res://res/ui/ui_026_fight/juxing744.png" id="1_yh6pq"]
|
||||
[ext_resource type="Texture2D" uid="uid://se3j07m0mm5p" path="res://res/ui/ui_026_fight/kaishizhandou.png" id="4_3x8hl"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6t1mn3dd73ox" path="res://scene/card_state_machine/card_machine.tscn" id="4_i7vc5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bdlo2wn4qnygv" path="res://scene/tool/tool_button.tscn" id="5_cxbtq"]
|
||||
[ext_resource type="PackedScene" uid="uid://8a2mwnnmnecl" path="res://scene/card.tscn" id="5_vknuj"]
|
||||
[ext_resource type="PackedScene" uid="uid://braadtw2q0x6u" path="res://scene/fight_character_card.tscn" id="6_5ixhk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dd4387syao6lj" path="res://scene/fight_enermy_card.tscn" id="7_fjnhq"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_246ik"]
|
||||
texture = ExtResource("1_yh6pq")
|
||||
texture_margin_left = 49.247
|
||||
texture_margin_top = 50.578
|
||||
texture_margin_right = 67.881
|
||||
texture_margin_bottom = 7.986
|
||||
|
||||
[node name="fight" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_1e3ie")
|
||||
|
||||
[node name="back" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_08haj")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
anchor_left = 0.0260417
|
||||
anchor_top = 0.728704
|
||||
anchor_right = 0.833854
|
||||
anchor_bottom = 0.960185
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_246ik")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="card_machine" parent="Panel" instance=ExtResource("4_i7vc5")]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -0.499817
|
||||
offset_top = 0.000274658
|
||||
offset_right = -0.499817
|
||||
offset_bottom = 0.000274658
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="card" parent="Panel/card_machine" instance=ExtResource("5_vknuj")]
|
||||
offset_left = -775.0
|
||||
offset_top = -125.0
|
||||
offset_right = -775.0
|
||||
offset_bottom = -125.0
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
anchor_left = 0.409896
|
||||
anchor_top = 0.237963
|
||||
anchor_right = 0.613542
|
||||
anchor_bottom = 0.337037
|
||||
offset_right = -351.0
|
||||
offset_bottom = -67.0
|
||||
texture = ExtResource("4_3x8hl")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ToolButton" parent="TextureRect" instance=ExtResource("5_cxbtq")]
|
||||
layout_mode = 1
|
||||
|
||||
[node name="character_card_add_pos" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.0260417
|
||||
anchor_top = 0.45463
|
||||
anchor_right = 0.984896
|
||||
anchor_bottom = 0.686111
|
||||
theme_override_constants/separation = 20
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="fight_character_card" parent="character_card_add_pos" instance=ExtResource("6_5ixhk")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="fight_character_card2" parent="character_card_add_pos" instance=ExtResource("6_5ixhk")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="enermy_card_add_pos" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.0260417
|
||||
anchor_right = 0.986979
|
||||
anchor_bottom = 0.231481
|
||||
theme_override_constants/separation = 20
|
||||
alignment = 2
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="fight_enermy_card" parent="enermy_card_add_pos" instance=ExtResource("7_fjnhq")]
|
||||
layout_mode = 2
|
16
scene/fight.gd
Normal file
16
scene/fight.gd
Normal file
@ -0,0 +1,16 @@
|
||||
extends Control
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_tool_button_pressed() -> void:
|
||||
%card_machine.add_card("xxx",1)
|
||||
pass # Replace with function body.
|
@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://sn3v7t7xjr1o"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://sn3v7t7xjr1o"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/fight.gd" id="1_1e3ie"]
|
||||
[ext_resource type="Texture2D" uid="uid://b1wfklbrwhh3y" path="res://res/ui/ui_025_adventure_mode/tuceng349.png" id="1_08haj"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc1ldr8rx3te3" path="res://res/ui/ui_026_fight/juxing744.png" id="1_yh6pq"]
|
||||
[ext_resource type="PackedScene" uid="uid://chowelwcfnsxs" path="res://scene/fight_card.tscn" id="3_3k0nd"]
|
||||
[ext_resource type="Texture2D" uid="uid://se3j07m0mm5p" path="res://res/ui/ui_026_fight/kaishizhandou.png" id="4_3x8hl"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6t1mn3dd73ox" path="res://scene/card_state_machine/card_machine.tscn" id="4_i7vc5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bdlo2wn4qnygv" path="res://scene/tool/tool_button.tscn" id="5_cxbtq"]
|
||||
[ext_resource type="PackedScene" uid="uid://braadtw2q0x6u" path="res://scene/fight_character_card.tscn" id="6_5ixhk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dd4387syao6lj" path="res://scene/fight_enermy_card.tscn" id="7_fjnhq"]
|
||||
@ -22,6 +23,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_1e3ie")
|
||||
|
||||
[node name="back" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
@ -34,35 +36,6 @@ texture = ExtResource("1_08haj")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
anchor_left = 0.0260417
|
||||
anchor_top = 0.728704
|
||||
anchor_right = 0.833854
|
||||
anchor_bottom = 0.960185
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_246ik")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="fight_card" parent="Panel/HBoxContainer" instance=ExtResource("3_3k0nd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="fight_card2" parent="Panel/HBoxContainer" instance=ExtResource("3_3k0nd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="fight_card3" parent="Panel/HBoxContainer" instance=ExtResource("3_3k0nd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="fight_card4" parent="Panel/HBoxContainer" instance=ExtResource("3_3k0nd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
anchor_left = 0.409896
|
||||
@ -105,3 +78,30 @@ metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="fight_enermy_card" parent="enermy_card_add_pos" instance=ExtResource("7_fjnhq")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.0260417
|
||||
anchor_top = 0.728704
|
||||
anchor_right = 0.833854
|
||||
anchor_bottom = 0.960185
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_246ik")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="card_machine" parent="Panel" instance=ExtResource("4_i7vc5")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 239.0
|
||||
offset_bottom = 80.0
|
||||
text = "添加卡牌"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ToolButton" parent="Label" instance=ExtResource("5_cxbtq")]
|
||||
layout_mode = 1
|
||||
|
||||
[connection signal="pressed" from="Label/ToolButton" to="." method="_on_tool_button_pressed"]
|
||||
|
@ -9,10 +9,12 @@
|
||||
|
||||
[node name="fight_card" type="TextureRect"]
|
||||
material = SubResource("ShaderMaterial_i0euk")
|
||||
layout_direction = 1
|
||||
offset_left = -94.0
|
||||
offset_top = -125.0
|
||||
offset_right = 95.0
|
||||
offset_bottom = 125.0
|
||||
pivot_offset = Vector2(94, 125)
|
||||
texture = ExtResource("1_2g5f6")
|
||||
expand_mode = 3
|
||||
script = ExtResource("2_nlhl0")
|
||||
@ -20,7 +22,6 @@ script = ExtResource("2_nlhl0")
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
show_behind_parent = true
|
||||
clip_children = 2
|
||||
light_mask = 9
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://braadtw2q0x6u"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://braadtw2q0x6u"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cn2q8k4s3bxiu" path="res://res/ui/ui_026_fight/juxing744_1.png" id="1_oi31c"]
|
||||
[ext_resource type="Script" path="res://scene/fight_character_card.gd" id="2_berqc"]
|
||||
@ -9,6 +9,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://deecs52usa3ie" path="res://res/ui/ui_026_fight/juxing768_1.png" id="6_j0vci"]
|
||||
[ext_resource type="Texture2D" uid="uid://dupfisl50axgw" path="res://res/ui/ui_026_fight/juxing768_2.png" id="7_wx32q"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oitb8"]
|
||||
size = Vector2(457, 252)
|
||||
|
||||
[node name="fight_character_card" type="TextureRect"]
|
||||
offset_right = 450.0
|
||||
offset_bottom = 250.0
|
||||
@ -165,3 +168,9 @@ grow_vertical = 2
|
||||
text = "999/999"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(224.5, 124)
|
||||
shape = SubResource("RectangleShape2D_oitb8")
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dd4387syao6lj"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dd4387syao6lj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://clmrqr17vnoda" path="res://res/ui/ui_026_fight/juxing804.png" id="1_c6q2o"]
|
||||
[ext_resource type="Texture2D" uid="uid://lipjl5h1d776" path="res://res/ui/ui_026_fight/tuceng285_1.png" id="2_ac0qe"]
|
||||
@ -8,6 +8,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://deecs52usa3ie" path="res://res/ui/ui_026_fight/juxing768_1.png" id="6_x31v6"]
|
||||
[ext_resource type="Texture2D" uid="uid://dupfisl50axgw" path="res://res/ui/ui_026_fight/juxing768_2.png" id="7_4wsqq"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ut4q5"]
|
||||
size = Vector2(453, 249)
|
||||
|
||||
[node name="fight_enermy_card" type="TextureRect"]
|
||||
offset_right = 450.0
|
||||
offset_bottom = 250.0
|
||||
@ -165,3 +168,9 @@ grow_vertical = 2
|
||||
text = "999/999"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(226.5, 125.5)
|
||||
shape = SubResource("RectangleShape2D_ut4q5")
|
||||
|
Loading…
Reference in New Issue
Block a user