gd: added input addon
6
guide_examples/2d_axis_mapping/2d_axis_mapping.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends Node
|
||||
|
||||
@export var mapping_context:GUIDEMappingContext
|
||||
|
||||
func _ready():
|
||||
GUIDE.enable_mapping_context(mapping_context)
|
1
guide_examples/2d_axis_mapping/2d_axis_mapping.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cl57fk6xess4f
|
42
guide_examples/2d_axis_mapping/2d_axis_mapping.tscn
Normal file
@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dvbxt8jyo8okq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="1_4tef3"]
|
||||
[ext_resource type="Script" path="res://guide_examples/2d_axis_mapping/2d_axis_mapping.gd" id="1_vdstu"]
|
||||
[ext_resource type="Script" path="res://guide_examples/2d_axis_mapping/player.gd" id="2_54pxx"]
|
||||
[ext_resource type="Resource" uid="uid://2hl7iqpondhi" path="res://guide_examples/input_scheme_switching/mapping_contexts/keyboard_scheme.tres" id="2_jtcd0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="5_ewox0"]
|
||||
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="5_h0lne"]
|
||||
[ext_resource type="Resource" uid="uid://cxn2ibe1mn3sb" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/move.tres" id="8_581qd"]
|
||||
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="8_p4vbo"]
|
||||
|
||||
[node name="2DAxisMapping" type="Node"]
|
||||
script = ExtResource("1_vdstu")
|
||||
mapping_context = ExtResource("2_jtcd0")
|
||||
|
||||
[node name="Player" type="Sprite2D" parent="."]
|
||||
position = Vector2(546, 317)
|
||||
texture = ExtResource("1_4tef3")
|
||||
script = ExtResource("2_54pxx")
|
||||
move_action = ExtResource("8_581qd")
|
||||
|
||||
[node name="UI Layer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Instructions Label" type="RichTextLabel" parent="UI Layer"]
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -286.0
|
||||
offset_top = 24.0
|
||||
offset_right = -39.0
|
||||
offset_bottom = 47.0
|
||||
grow_horizontal = 0
|
||||
theme = ExtResource("8_p4vbo")
|
||||
script = ExtResource("5_h0lne")
|
||||
instructions_text = "Use %s to move the player."
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("8_581qd")])
|
||||
|
||||
[node name="Debug Layer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GuideDebugger" parent="Debug Layer" instance=ExtResource("5_ewox0")]
|
||||
theme = ExtResource("8_p4vbo")
|
||||
metadata/_edit_lock_ = true
|
@ -0,0 +1,115 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=21 format=3 uid="uid://2hl7iqpondhj"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://cxn2ibe1mn3sb" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/move.tres" id="1_5vw7l"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="2_0yrlp"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="3_ad6sj"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="3_nlxx1"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="4_16vkk"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_input_swizzle.gd" id="5_qr6a5"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="8_r1avn"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_t51n6"]
|
||||
script = ExtResource("2_0yrlp")
|
||||
key = 87
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ct0te"]
|
||||
script = ExtResource("3_nlxx1")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qm6gq"]
|
||||
script = ExtResource("5_qr6a5")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yewp7"]
|
||||
script = ExtResource("3_ad6sj")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_t51n6")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_ct0te"), SubResource("Resource_qm6gq")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_c40re"]
|
||||
script = ExtResource("2_0yrlp")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rkxfa"]
|
||||
script = ExtResource("3_nlxx1")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6qgwf"]
|
||||
script = ExtResource("3_ad6sj")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_c40re")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_rkxfa")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2t3ts"]
|
||||
script = ExtResource("2_0yrlp")
|
||||
key = 83
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_eoiu5"]
|
||||
script = ExtResource("5_qr6a5")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_bilhe"]
|
||||
script = ExtResource("3_ad6sj")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_2t3ts")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_eoiu5")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lften"]
|
||||
script = ExtResource("2_0yrlp")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_v2qov"]
|
||||
script = ExtResource("3_ad6sj")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_lften")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_u0xy6"]
|
||||
script = ExtResource("4_16vkk")
|
||||
action = ExtResource("1_5vw7l")
|
||||
input_mappings = Array[ExtResource("3_ad6sj")]([SubResource("Resource_yewp7"), SubResource("Resource_6qgwf"), SubResource("Resource_bilhe"), SubResource("Resource_v2qov")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("8_r1avn")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("4_16vkk")]([SubResource("Resource_u0xy6")])
|
12
guide_examples/2d_axis_mapping/mapping_contexts/move.tres
Normal file
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cxn2ibe1mn3sa"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_anxy1"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_anxy1")
|
||||
name = &""
|
||||
action_value_type = 2
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
10
guide_examples/2d_axis_mapping/player.gd
Normal file
@ -0,0 +1,10 @@
|
||||
## A very simple player script for a player who can only move.
|
||||
extends Node2D
|
||||
|
||||
@export var speed:float = 300
|
||||
@export var move_action:GUIDEAction
|
||||
|
||||
func _process(delta:float) -> void:
|
||||
# GUIDE already gives us a full 2D axis. We don't need to build it
|
||||
# ourselves using Input.get_vector.
|
||||
position += move_action.value_axis_2d.normalized() * speed * delta
|
1
guide_examples/2d_axis_mapping/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b3l3w1askqxgo
|
14
guide_examples/action_priority/action_priority.gd
Normal file
@ -0,0 +1,14 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
@export var mapping_context:GUIDEMappingContext
|
||||
@export var spell_toggle:GUIDEAction
|
||||
|
||||
@onready var _layer_1:Control = %Layer1
|
||||
@onready var _layer_2:Control = %Layer2
|
||||
|
||||
|
||||
func _ready():
|
||||
GUIDE.enable_mapping_context(mapping_context)
|
||||
spell_toggle.triggered.connect(func(): _layer_1.hide(); _layer_2.show())
|
||||
spell_toggle.completed.connect(func(): _layer_1.show(); _layer_2.hide())
|
1
guide_examples/action_priority/action_priority.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cycxhrywjuggp
|
125
guide_examples/action_priority/action_priority.tscn
Normal file
@ -0,0 +1,125 @@
|
||||
[gd_scene load_steps=25 format=3 uid="uid://c03o20jchp7kb"]
|
||||
|
||||
[ext_resource type="Script" path="res://guide_examples/action_priority/action_priority.gd" id="1_segid"]
|
||||
[ext_resource type="Resource" uid="uid://ragqbe7yjfwe" path="res://guide_examples/action_priority/mapping_contexts/action_priority.tres" id="2_spx2e"]
|
||||
[ext_resource type="Resource" uid="uid://c5eq1avod0lu8" path="res://guide_examples/action_priority/mapping_contexts/actions/spell_toggle.tres" id="3_k38f6"]
|
||||
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="3_ocaq1"]
|
||||
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="4_ur8xb"]
|
||||
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="4_v7mqo"]
|
||||
[ext_resource type="Resource" uid="uid://esf4ilpf0inv" path="res://guide_examples/action_priority/mapping_contexts/actions/acid_bolt.tres" id="5_oqj0p"]
|
||||
[ext_resource type="Resource" uid="uid://bhq3gby2yiibf" path="res://guide_examples/action_priority/mapping_contexts/actions/acid_enchantment.tres" id="6_ue1ny"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsv0uwfyqbbbw" path="res://guide_examples/action_priority/dpad_spells/dpad_spells.tscn" id="7_48cit"]
|
||||
[ext_resource type="Resource" uid="uid://cdhpb7yuq5pkb" path="res://guide_examples/action_priority/mapping_contexts/actions/mana_bolt.tres" id="7_ruu3d"]
|
||||
[ext_resource type="Texture2D" uid="uid://emjksgvvx8kr" path="res://guide_examples/action_priority/icons/fireball-acid-3.png" id="8_pbht4"]
|
||||
[ext_resource type="Resource" uid="uid://dsp8h1ycwd6tt" path="res://guide_examples/action_priority/mapping_contexts/actions/heal.tres" id="8_tl0ch"]
|
||||
[ext_resource type="Texture2D" uid="uid://do0b76wher5pk" path="res://guide_examples/action_priority/icons/fireball-sky-3.png" id="9_6ehip"]
|
||||
[ext_resource type="Resource" uid="uid://b5plj56pss47x" path="res://guide_examples/action_priority/mapping_contexts/actions/shield.tres" id="9_rbwtd"]
|
||||
[ext_resource type="Texture2D" uid="uid://bb2whckygsgvj" path="res://guide_examples/action_priority/icons/heal-royal-3.png" id="10_vp0as"]
|
||||
[ext_resource type="Resource" uid="uid://do3hivxhwoqvi" path="res://guide_examples/action_priority/mapping_contexts/actions/mana_enchantment.tres" id="11_223o5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvy7bcy022rqq" path="res://guide_examples/action_priority/icons/protect-blue-2.png" id="11_t3r7p"]
|
||||
[ext_resource type="Texture2D" uid="uid://dbwgq8udtj2hp" path="res://guide_examples/action_priority/icons/enchant-acid-3.png" id="12_2ht6b"]
|
||||
[ext_resource type="Resource" uid="uid://dtr3jy86gc3rk" path="res://guide_examples/action_priority/mapping_contexts/actions/healing_enchantment.tres" id="12_4o7kv"]
|
||||
[ext_resource type="Resource" uid="uid://bfskfiw1k8574" path="res://guide_examples/action_priority/mapping_contexts/actions/fire_enchantment.tres" id="13_6g6j5"]
|
||||
[ext_resource type="Texture2D" uid="uid://b3j6yx4455rj0" path="res://guide_examples/action_priority/icons/enchant-blue-3.png" id="13_yufl8"]
|
||||
[ext_resource type="Texture2D" uid="uid://djexj402ii0qp" path="res://guide_examples/action_priority/icons/enchant-jade-3.png" id="14_dpiqo"]
|
||||
[ext_resource type="PackedScene" uid="uid://cx8f0hljh5dhs" path="res://guide_examples/action_priority/spell_indicator/spell_indicator.tscn" id="14_gmycm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bcls6cfcyhf0t" path="res://guide_examples/action_priority/icons/enchant-red-3.png" id="15_xjepw"]
|
||||
|
||||
[node name="ActionPriority" type="Node2D"]
|
||||
script = ExtResource("1_segid")
|
||||
mapping_context = ExtResource("2_spx2e")
|
||||
spell_toggle = ExtResource("3_k38f6")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Instructions Label" type="RichTextLabel" parent="UILayer"]
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -78.0
|
||||
offset_top = 19.0
|
||||
offset_right = -38.0
|
||||
offset_bottom = 42.0
|
||||
grow_horizontal = 0
|
||||
theme = ExtResource("4_ur8xb")
|
||||
script = ExtResource("4_v7mqo")
|
||||
instructions_text = "%s - acid bolt
|
||||
%s - mana bolt
|
||||
%s - heal
|
||||
%s - shield
|
||||
%s - acid enchantment
|
||||
%s - mana enchantment
|
||||
%s - healing enchantment
|
||||
%s - fire enchantment"
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("5_oqj0p"), ExtResource("7_ruu3d"), ExtResource("8_tl0ch"), ExtResource("9_rbwtd"), ExtResource("6_ue1ny"), ExtResource("11_223o5"), ExtResource("12_4o7kv"), ExtResource("13_6g6j5")])
|
||||
|
||||
[node name="SpellIndicators" type="Node2D" parent="UILayer"]
|
||||
position = Vector2(1149, 781)
|
||||
|
||||
[node name="AcidBolt" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("5_oqj0p")
|
||||
texture = ExtResource("8_pbht4")
|
||||
|
||||
[node name="ManaBolt" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("7_ruu3d")
|
||||
texture = ExtResource("9_6ehip")
|
||||
|
||||
[node name="Heal" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("8_tl0ch")
|
||||
texture = ExtResource("10_vp0as")
|
||||
|
||||
[node name="Shield" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("9_rbwtd")
|
||||
texture = ExtResource("11_t3r7p")
|
||||
|
||||
[node name="AcidEnchant" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("6_ue1ny")
|
||||
texture = ExtResource("12_2ht6b")
|
||||
|
||||
[node name="ManaEnchant" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("11_223o5")
|
||||
texture = ExtResource("13_yufl8")
|
||||
|
||||
[node name="HealingEnchant" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("12_4o7kv")
|
||||
texture = ExtResource("14_dpiqo")
|
||||
|
||||
[node name="FireEnchant" parent="UILayer/SpellIndicators" instance=ExtResource("14_gmycm")]
|
||||
action = ExtResource("13_6g6j5")
|
||||
texture = ExtResource("15_xjepw")
|
||||
|
||||
[node name="Spells" type="MarginContainer" parent="UILayer"]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -529.0
|
||||
offset_top = 5.0
|
||||
offset_right = -85.0
|
||||
offset_bottom = 455.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset = Vector2(171, 194)
|
||||
|
||||
[node name="Layer1" parent="UILayer/Spells" instance=ExtResource("7_48cit")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
up = ExtResource("8_pbht4")
|
||||
left = ExtResource("9_6ehip")
|
||||
right = ExtResource("10_vp0as")
|
||||
down = ExtResource("11_t3r7p")
|
||||
|
||||
[node name="Layer2" parent="UILayer/Spells" instance=ExtResource("7_48cit")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
up = ExtResource("12_2ht6b")
|
||||
left = ExtResource("13_yufl8")
|
||||
right = ExtResource("14_dpiqo")
|
||||
down = ExtResource("15_xjepw")
|
||||
|
||||
[node name="DebugLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GuideDebugger" parent="DebugLayer" instance=ExtResource("3_ocaq1")]
|
||||
theme = ExtResource("4_ur8xb")
|
52
guide_examples/action_priority/dpad_spells/dpad_spells.gd
Normal file
@ -0,0 +1,52 @@
|
||||
@tool
|
||||
extends GridContainer
|
||||
|
||||
@onready var _up:TextureRect = %Up
|
||||
@onready var _left:TextureRect = %Left
|
||||
@onready var _right:TextureRect = %Right
|
||||
@onready var _down:TextureRect = %Down
|
||||
|
||||
|
||||
@export var up:Texture2D:
|
||||
set(value):
|
||||
if value == up:
|
||||
return
|
||||
up = value
|
||||
_refresh()
|
||||
|
||||
|
||||
@export var left:Texture2D:
|
||||
set(value):
|
||||
if value == left:
|
||||
return
|
||||
left = value
|
||||
_refresh()
|
||||
|
||||
|
||||
@export var right:Texture2D:
|
||||
set(value):
|
||||
if value == right:
|
||||
return
|
||||
right= value
|
||||
_refresh()
|
||||
|
||||
@export var down:Texture2D:
|
||||
set(value):
|
||||
if value == down:
|
||||
return
|
||||
down = value
|
||||
_refresh()
|
||||
|
||||
|
||||
func _ready():
|
||||
_refresh()
|
||||
|
||||
|
||||
func _refresh():
|
||||
if not is_node_ready():
|
||||
return
|
||||
|
||||
_up.texture = up
|
||||
_down.texture = down
|
||||
_left.texture = left
|
||||
_right.texture = right
|
@ -0,0 +1 @@
|
||||
uid://wsbm3iwylkto
|
56
guide_examples/action_priority/dpad_spells/dpad_spells.tscn
Normal file
@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bsv0uwfyqbbbw"]
|
||||
|
||||
[ext_resource type="Script" path="res://guide_examples/action_priority/dpad_spells/dpad_spells.gd" id="1_pl5jh"]
|
||||
|
||||
[node name="DpadSpells" type="GridContainer"]
|
||||
offset_right = 323.0
|
||||
offset_bottom = 329.0
|
||||
columns = 3
|
||||
script = ExtResource("1_pl5jh")
|
||||
|
||||
[node name="Spacer" type="Control" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Up" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Spacer2" type="Control" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Left" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Spacer3" type="Control" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Right" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Spacer4" type="Control" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Down" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Spacer5" type="Control" parent="."]
|
||||
layout_mode = 2
|
BIN
guide_examples/action_priority/icons/enchant-acid-3.png
Normal file
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dbwgq8udtj2hp"
|
||||
path="res://.godot/imported/enchant-acid-3.png-e1947aa390c674d1399abe634bc54deb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/enchant-acid-3.png"
|
||||
dest_files=["res://.godot/imported/enchant-acid-3.png-e1947aa390c674d1399abe634bc54deb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/enchant-blue-3.png
Normal file
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b3j6yx4455rj0"
|
||||
path="res://.godot/imported/enchant-blue-3.png-7fbde34e03a870571687bd67f54ff1a7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/enchant-blue-3.png"
|
||||
dest_files=["res://.godot/imported/enchant-blue-3.png-7fbde34e03a870571687bd67f54ff1a7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/enchant-jade-3.png
Normal file
After Width: | Height: | Size: 78 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://djexj402ii0qp"
|
||||
path="res://.godot/imported/enchant-jade-3.png-dbada551fd0e4cb0fb15a3867cb2ef6b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/enchant-jade-3.png"
|
||||
dest_files=["res://.godot/imported/enchant-jade-3.png-dbada551fd0e4cb0fb15a3867cb2ef6b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/enchant-red-3.png
Normal file
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcls6cfcyhf0t"
|
||||
path="res://.godot/imported/enchant-red-3.png-82aa47d9224cc61c8bdf354866612b90.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/enchant-red-3.png"
|
||||
dest_files=["res://.godot/imported/enchant-red-3.png-82aa47d9224cc61c8bdf354866612b90.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/fireball-acid-3.png
Normal file
After Width: | Height: | Size: 87 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://emjksgvvx8kr"
|
||||
path="res://.godot/imported/fireball-acid-3.png-17a549b7e763ef3fa4170fd9d37c6d27.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/fireball-acid-3.png"
|
||||
dest_files=["res://.godot/imported/fireball-acid-3.png-17a549b7e763ef3fa4170fd9d37c6d27.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/fireball-sky-3.png
Normal file
After Width: | Height: | Size: 89 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://do0b76wher5pk"
|
||||
path="res://.godot/imported/fireball-sky-3.png-ef89177b310ec94cab7573ba28dfb564.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/fireball-sky-3.png"
|
||||
dest_files=["res://.godot/imported/fireball-sky-3.png-ef89177b310ec94cab7573ba28dfb564.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/heal-royal-3.png
Normal file
After Width: | Height: | Size: 74 KiB |
34
guide_examples/action_priority/icons/heal-royal-3.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bb2whckygsgvj"
|
||||
path="res://.godot/imported/heal-royal-3.png-a1b67309c29c3e0722cb4efa430d5f09.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/heal-royal-3.png"
|
||||
dest_files=["res://.godot/imported/heal-royal-3.png-a1b67309c29c3e0722cb4efa430d5f09.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
guide_examples/action_priority/icons/protect-blue-2.png
Normal file
After Width: | Height: | Size: 94 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvy7bcy022rqq"
|
||||
path="res://.godot/imported/protect-blue-2.png-abb9ef1d1e06e180429074d0e9b24edb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/action_priority/icons/protect-blue-2.png"
|
||||
dest_files=["res://.godot/imported/protect-blue-2.png-abb9ef1d1e06e180429074d0e9b24edb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,263 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=56 format=3 uid="uid://ragqbe7yjfwe"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="1_asqiw"]
|
||||
[ext_resource type="Resource" uid="uid://bhq3gby2yiibf" path="res://guide_examples/action_priority/mapping_contexts/actions/acid_enchantment.tres" id="1_pwefn"]
|
||||
[ext_resource type="Resource" uid="uid://c5eq1avod0lu8" path="res://guide_examples/action_priority/mapping_contexts/actions/spell_toggle.tres" id="2_swo1r"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="4_6rx1x"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="4_n7mmu"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_joy_button.gd" id="5_cxbyx"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_chorded_action.gd" id="5_w86oe"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="6_4koxr"]
|
||||
[ext_resource type="Resource" uid="uid://esf4ilpf0inv" path="res://guide_examples/action_priority/mapping_contexts/actions/acid_bolt.tres" id="7_35imv"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_joy_axis_1d.gd" id="8_avuuj"]
|
||||
[ext_resource type="Resource" uid="uid://do3hivxhwoqvi" path="res://guide_examples/action_priority/mapping_contexts/actions/mana_enchantment.tres" id="8_lmhmq"]
|
||||
[ext_resource type="Resource" uid="uid://dtr3jy86gc3rk" path="res://guide_examples/action_priority/mapping_contexts/actions/healing_enchantment.tres" id="9_xfl3h"]
|
||||
[ext_resource type="Resource" uid="uid://cdhpb7yuq5pkb" path="res://guide_examples/action_priority/mapping_contexts/actions/mana_bolt.tres" id="10_krd45"]
|
||||
[ext_resource type="Resource" uid="uid://bfskfiw1k8574" path="res://guide_examples/action_priority/mapping_contexts/actions/fire_enchantment.tres" id="10_m3nrn"]
|
||||
[ext_resource type="Resource" uid="uid://dsp8h1ycwd6tt" path="res://guide_examples/action_priority/mapping_contexts/actions/heal.tres" id="12_w4t7r"]
|
||||
[ext_resource type="Resource" uid="uid://b5plj56pss47x" path="res://guide_examples/action_priority/mapping_contexts/actions/shield.tres" id="14_qai3i"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2fxes"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 11
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jhb3c"]
|
||||
script = ExtResource("5_w86oe")
|
||||
action = ExtResource("2_swo1r")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_i54ow"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fjuhd"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_2fxes")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_jhb3c"), SubResource("Resource_i54ow")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ai5ps"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("1_pwefn")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_fjuhd")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_w2qty"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 13
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rl1q7"]
|
||||
script = ExtResource("5_w86oe")
|
||||
action = ExtResource("2_swo1r")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4y1rh"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_d8nq3"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_w2qty")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_rl1q7"), SubResource("Resource_4y1rh")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jwd6q"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("8_lmhmq")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_d8nq3")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mxqg0"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 14
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ip7ia"]
|
||||
script = ExtResource("5_w86oe")
|
||||
action = ExtResource("2_swo1r")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_i6wfw"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_m8ya7"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_mxqg0")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_ip7ia"), SubResource("Resource_i6wfw")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_22c0i"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("9_xfl3h")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_m8ya7")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_u2m40"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 12
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7owy8"]
|
||||
script = ExtResource("5_w86oe")
|
||||
action = ExtResource("2_swo1r")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tchgu"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2q1gn"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_u2m40")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_7owy8"), SubResource("Resource_tchgu")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4acdf"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("10_m3nrn")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_2q1gn")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5sjq4"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 11
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fkk8p"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vswh4"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_5sjq4")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_fkk8p")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8wvmf"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("7_35imv")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_vswh4")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mbfh8"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 13
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_umt5k"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_b8our"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_mbfh8")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_umt5k")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8p32p"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("10_krd45")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_b8our")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_utha0"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 14
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_sm46b"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1f76r"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_utha0")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_sm46b")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_73ywc"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("12_w4t7r")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_1f76r")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ov80l"]
|
||||
script = ExtResource("5_cxbyx")
|
||||
button = 12
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wu6o8"]
|
||||
script = ExtResource("4_n7mmu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ggg1r"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_ov80l")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_wu6o8")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rleu1"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("14_qai3i")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_ggg1r")])
|
||||
metadata/_guide_input_mappings_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_m51uq"]
|
||||
script = ExtResource("8_avuuj")
|
||||
axis = 4
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2hg0t"]
|
||||
script = ExtResource("4_6rx1x")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_m51uq")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_uj8l6"]
|
||||
script = ExtResource("6_4koxr")
|
||||
action = ExtResource("2_swo1r")
|
||||
input_mappings = Array[ExtResource("4_6rx1x")]([SubResource("Resource_2hg0t")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_asqiw")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("6_4koxr")]([SubResource("Resource_ai5ps"), SubResource("Resource_jwd6q"), SubResource("Resource_22c0i"), SubResource("Resource_4acdf"), SubResource("Resource_8wvmf"), SubResource("Resource_8p32p"), SubResource("Resource_73ywc"), SubResource("Resource_rleu1"), SubResource("Resource_uj8l6")])
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://esf4ilpf0inv"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_867co"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_867co")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bhq3gby2yiibf"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_w7kln"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_w7kln")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bfskfiw1k8574"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_rlep8"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_rlep8")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://dsp8h1ycwd6tt"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_o3iqb"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_o3iqb")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://dtr3jy86gc3rk"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_0fh74"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_0fh74")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cdhpb7yuq5pkb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_ka3gg"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ka3gg")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://do3hivxhwoqvi"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_4c7tt"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_4c7tt")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://b5plj56pss47x"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_kmjgp"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_kmjgp")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://c5eq1avod0lu8"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_m4tof"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_m4tof")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = false
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,11 @@
|
||||
extends Node2D
|
||||
|
||||
@export var action:GUIDEAction
|
||||
@export var texture:Texture2D
|
||||
|
||||
@onready var _animation_player:AnimationPlayer = %AnimationPlayer
|
||||
@onready var _sprite_2d:Sprite2D = %Sprite2D
|
||||
|
||||
func _ready():
|
||||
_sprite_2d.texture = texture
|
||||
action.triggered.connect(_animation_player.play.bind("run"))
|
@ -0,0 +1 @@
|
||||
uid://b3h0rac24v3l0
|
@ -0,0 +1,79 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cx8f0hljh5dhs"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dbwgq8udtj2hp" path="res://guide_examples/action_priority/icons/enchant-acid-3.png" id="1_7l2hh"]
|
||||
[ext_resource type="Script" path="res://guide_examples/action_priority/spell_indicator/spell_indicator.gd" id="1_hpegm"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_j3vtt"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_4iqo1"]
|
||||
resource_name = "run"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, -346)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 0.176777),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_h1go0"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_j3vtt"),
|
||||
"run": SubResource("Animation_4iqo1")
|
||||
}
|
||||
|
||||
[node name="SpellIndicator" type="Node2D"]
|
||||
script = ExtResource("1_hpegm")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("1_7l2hh")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_h1go0")
|
||||
}
|
7
guide_examples/combos/combos.gd
Normal file
@ -0,0 +1,7 @@
|
||||
extends Node2D
|
||||
|
||||
@export var mapping_context:GUIDEMappingContext
|
||||
|
||||
func _ready():
|
||||
GUIDE.enable_mapping_context(mapping_context)
|
||||
|
1
guide_examples/combos/combos.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dk0t3b28kxhf8
|
87
guide_examples/combos/combos.tscn
Normal file
@ -0,0 +1,87 @@
|
||||
[gd_scene load_steps=18 format=3 uid="uid://b12bmbtmbuame"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="1_eyn1y"]
|
||||
[ext_resource type="Script" path="res://guide_examples/combos/combos.gd" id="1_kdeb4"]
|
||||
[ext_resource type="Resource" uid="uid://c7uloa16ajj5p" path="res://guide_examples/combos/mapping_contexts/combos.tres" id="2_ahmv3"]
|
||||
[ext_resource type="Script" path="res://guide_examples/combos/player.gd" id="3_kulxp"]
|
||||
[ext_resource type="Resource" uid="uid://b2wemrcnxfbmo" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_horizontal.tres" id="4_7328w"]
|
||||
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="4_uej32"]
|
||||
[ext_resource type="Resource" uid="uid://b0761600n8fnb" path="res://guide_examples/combos/mapping_contexts/combo_actions/fireball_left.tres" id="4_uvwd5"]
|
||||
[ext_resource type="Resource" uid="uid://dj83uxjdx6r2c" path="res://guide_examples/combos/mapping_contexts/combo_actions/dash_left.tres" id="5_s5wpr"]
|
||||
[ext_resource type="Resource" uid="uid://5ve3hevhhgnw" path="res://guide_examples/combos/mapping_contexts/combo_actions/dash_right.tres" id="6_vd0bg"]
|
||||
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="11_i5q2v"]
|
||||
[ext_resource type="Resource" uid="uid://wdh7cg7kjul0" path="res://guide_examples/combos/mapping_contexts/combo_actions/fireball_right.tres" id="11_n707x"]
|
||||
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="11_obfhv"]
|
||||
[ext_resource type="Resource" uid="uid://bqiryilvj5mqv" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_left.tres" id="12_0mhlm"]
|
||||
[ext_resource type="PackedScene" uid="uid://c36cnvgv2ur60" path="res://guide_examples/shared/fireball/fireball.tscn" id="12_fl88r"]
|
||||
[ext_resource type="Resource" uid="uid://bk54ofxos3xxg" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_right.tres" id="13_xn6qb"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8kkfa"]
|
||||
size = Vector2(137, 138)
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_0s5wn"]
|
||||
|
||||
[node name="Combos" type="Node2D"]
|
||||
script = ExtResource("1_kdeb4")
|
||||
mapping_context = ExtResource("2_ahmv3")
|
||||
|
||||
[node name="Player" type="CharacterBody2D" parent="."]
|
||||
position = Vector2(902, 841)
|
||||
script = ExtResource("3_kulxp")
|
||||
dash_speed_bonus = 400.0
|
||||
horizontal_movement = ExtResource("4_7328w")
|
||||
dash_left = ExtResource("5_s5wpr")
|
||||
dash_right = ExtResource("6_vd0bg")
|
||||
fireball_left = ExtResource("4_uvwd5")
|
||||
fireball_right = ExtResource("11_n707x")
|
||||
fireball_scene = ExtResource("12_fl88r")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="Player"]
|
||||
texture = ExtResource("4_uej32")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||
position = Vector2(1.5, 1)
|
||||
shape = SubResource("RectangleShape2D_8kkfa")
|
||||
|
||||
[node name="Ground" type="StaticBody2D" parent="."]
|
||||
position = Vector2(-44, 954)
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Ground"]
|
||||
offset_left = -427.0
|
||||
offset_right = 2555.0
|
||||
offset_bottom = 150.0
|
||||
color = Color(0.285871, 0.0915713, 0.0208481, 1)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground"]
|
||||
position = Vector2(869, 1)
|
||||
shape = SubResource("WorldBoundaryShape2D_0s5wn")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="InstructionsLabel" type="RichTextLabel" parent="UILayer"]
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -482.0
|
||||
offset_top = 21.0
|
||||
offset_bottom = 205.0
|
||||
grow_horizontal = 0
|
||||
theme = ExtResource("11_i5q2v")
|
||||
bbcode_enabled = true
|
||||
text = "Lore, ipsum dolor sit amet."
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
script = ExtResource("11_obfhv")
|
||||
instructions_text = "Press %s to move left.
|
||||
Press %s to move right.
|
||||
Press %s to dash left.
|
||||
Press %s to dash right.
|
||||
Press %s shoot a fireball to the left.
|
||||
Press %s to shoot a fireball to the right."
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("12_0mhlm"), ExtResource("13_xn6qb"), ExtResource("5_s5wpr"), ExtResource("6_vd0bg"), ExtResource("4_uvwd5"), ExtResource("11_n707x")])
|
||||
|
||||
[node name="DebuggerLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GuideDebugger" parent="DebuggerLayer" instance=ExtResource("1_eyn1y")]
|
||||
theme = ExtResource("11_i5q2v")
|
||||
metadata/_edit_lock_ = true
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cgr4iegvrkebx"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_pxjqb"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_pxjqb")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = "Player Controls"
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://b2wemrcnxfbmo"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_bg42k"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_bg42k")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bqiryilvj5mqv"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_pxjqb"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_pxjqb")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bk54ofxos3xxg"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_ppgom"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ppgom")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://dj83uxjdx6r2c"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_hxh8l"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_hxh8l")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://5ve3hevhhgnw"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_cbjx7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_cbjx7")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://b0761600n8fnb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_exrdu"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_exrdu")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://wdh7cg7kjul0"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_clys2"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_clys2")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
299
guide_examples/combos/mapping_contexts/combos.tres
Normal file
@ -0,0 +1,299 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=57 format=3 uid="uid://c7uloa16ajj5p"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="1_bycs2"]
|
||||
[ext_resource type="Resource" uid="uid://bqiryilvj5mqv" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_left.tres" id="1_pb347"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="2_o8ffe"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="2_wsx31"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="3_dnh2v"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="3_ji605"]
|
||||
[ext_resource type="Resource" uid="uid://bk54ofxos3xxg" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_right.tres" id="5_jksbs"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_action.gd" id="8_04uuh"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_combo_cancel_action.gd" id="8_ewrgg"]
|
||||
[ext_resource type="Resource" uid="uid://5ve3hevhhgnw" path="res://guide_examples/combos/mapping_contexts/combo_actions/dash_right.tres" id="9_ciqk8"]
|
||||
[ext_resource type="Resource" uid="uid://b0761600n8fnb" path="res://guide_examples/combos/mapping_contexts/combo_actions/fireball_left.tres" id="9_lvx6c"]
|
||||
[ext_resource type="Resource" uid="uid://wdh7cg7kjul0" path="res://guide_examples/combos/mapping_contexts/combo_actions/fireball_right.tres" id="12_icm8e"]
|
||||
[ext_resource type="Resource" uid="uid://b2wemrcnxfbmo" path="res://guide_examples/combos/mapping_contexts/basic_actions/move_horizontal.tres" id="13_u4d84"]
|
||||
[ext_resource type="Resource" uid="uid://cgr4iegvrkebx" path="res://guide_examples/combos/mapping_contexts/basic_actions/fire.tres" id="17_yw71c"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_combo.gd" id="19_kw0e0"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_combo_step.gd" id="20_226av"]
|
||||
[ext_resource type="Resource" uid="uid://dj83uxjdx6r2c" path="res://guide_examples/combos/mapping_contexts/combo_actions/dash_left.tres" id="21_wfbjl"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_le3gd"]
|
||||
script = ExtResource("2_wsx31")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jphf8"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_le3gd")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
metadata/_guide_modifiers_collapsed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ohm7l"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("1_pb347")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_jphf8")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_bf80h"]
|
||||
script = ExtResource("2_wsx31")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o2rir"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_bf80h")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_3ojw4"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("5_jksbs")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_o2rir")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xe8bg"]
|
||||
script = ExtResource("8_04uuh")
|
||||
action = ExtResource("1_pb347")
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tisnm"]
|
||||
script = ExtResource("3_ji605")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6q14n"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_xe8bg")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_tisnm")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_p31qj"]
|
||||
script = ExtResource("8_04uuh")
|
||||
action = ExtResource("5_jksbs")
|
||||
|
||||
[sub_resource type="Resource" id="Resource_m3jub"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_p31qj")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_nypfm"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("13_u4d84")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_6q14n"), SubResource("Resource_m3jub")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rgf84"]
|
||||
script = ExtResource("2_wsx31")
|
||||
key = 32
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wf4jl"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_rgf84")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qxroc"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("17_yw71c")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_wf4jl")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ai4v6"]
|
||||
script = ExtResource("8_ewrgg")
|
||||
action = ExtResource("5_jksbs")
|
||||
completion_events = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_22wmg"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("1_pb347")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_m5xce"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("1_pb347")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_bc2sa"]
|
||||
script = ExtResource("19_kw0e0")
|
||||
enable_debug_print = false
|
||||
steps = Array[ExtResource("20_226av")]([SubResource("Resource_22wmg"), SubResource("Resource_m5xce")])
|
||||
cancellation_actions = Array[ExtResource("8_ewrgg")]([SubResource("Resource_ai4v6")])
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_00r0g"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_bc2sa")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_abarl"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("21_wfbjl")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_00r0g")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_w3it8"]
|
||||
script = ExtResource("8_ewrgg")
|
||||
action = ExtResource("1_pb347")
|
||||
completion_events = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o1r17"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("5_jksbs")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_y7323"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("5_jksbs")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0x6c4"]
|
||||
script = ExtResource("19_kw0e0")
|
||||
enable_debug_print = false
|
||||
steps = Array[ExtResource("20_226av")]([SubResource("Resource_o1r17"), SubResource("Resource_y7323")])
|
||||
cancellation_actions = Array[ExtResource("8_ewrgg")]([SubResource("Resource_w3it8")])
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wnc21"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_0x6c4")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1vsh7"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("9_ciqk8")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_wnc21")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_cbc1w"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("5_jksbs")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_k4x1t"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("1_pb347")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ryygs"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("17_yw71c")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wocqt"]
|
||||
script = ExtResource("19_kw0e0")
|
||||
enable_debug_print = false
|
||||
steps = Array[ExtResource("20_226av")]([SubResource("Resource_cbc1w"), SubResource("Resource_k4x1t"), SubResource("Resource_ryygs")])
|
||||
cancellation_actions = Array[ExtResource("8_ewrgg")]([])
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_v7om3"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_wocqt")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_40qct"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("9_lvx6c")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_v7om3")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2ivmb"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("1_pb347")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o88yx"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("5_jksbs")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_j6a01"]
|
||||
script = ExtResource("20_226av")
|
||||
action = ExtResource("17_yw71c")
|
||||
completion_events = 16
|
||||
time_to_actuate = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lonke"]
|
||||
script = ExtResource("19_kw0e0")
|
||||
enable_debug_print = false
|
||||
steps = Array[ExtResource("20_226av")]([SubResource("Resource_2ivmb"), SubResource("Resource_o88yx"), SubResource("Resource_j6a01")])
|
||||
cancellation_actions = Array[ExtResource("8_ewrgg")]([])
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_do51u"]
|
||||
script = ExtResource("3_dnh2v")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_lonke")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pn365"]
|
||||
script = ExtResource("2_o8ffe")
|
||||
action = ExtResource("12_icm8e")
|
||||
input_mappings = Array[ExtResource("3_dnh2v")]([SubResource("Resource_do51u")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_bycs2")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("2_o8ffe")]([SubResource("Resource_ohm7l"), SubResource("Resource_3ojw4"), SubResource("Resource_nypfm"), SubResource("Resource_qxroc"), SubResource("Resource_abarl"), SubResource("Resource_1vsh7"), SubResource("Resource_40qct"), SubResource("Resource_pn365")])
|
||||
metadata/_guide_action_mappings_collapsed = false
|
50
guide_examples/combos/player.gd
Normal file
@ -0,0 +1,50 @@
|
||||
## This is a somewhat more complex player example. Note how all the combos
|
||||
## are completely handled by GUIDE, the player doesn't need to know which
|
||||
## inputs trigger them.
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var speed:float = 150
|
||||
@export var dash_speed_bonus:float = 250
|
||||
|
||||
@export var horizontal_movement:GUIDEAction
|
||||
@export var dash_left:GUIDEAction
|
||||
@export var dash_right:GUIDEAction
|
||||
@export var fireball_left:GUIDEAction
|
||||
@export var fireball_right:GUIDEAction
|
||||
|
||||
@export var fireball_scene:PackedScene
|
||||
|
||||
var _dash_bonus:float
|
||||
|
||||
func _ready():
|
||||
# We can use the event system to get notified whenever
|
||||
# the combo actions trigger. This way we don't need to check them
|
||||
# in _physics_process every frame.
|
||||
dash_left.triggered.connect(func(): _dash_bonus = -1)
|
||||
dash_right.triggered.connect(func(): _dash_bonus = 1)
|
||||
fireball_left.triggered.connect(_spawn_fireball.bind(Vector2.LEFT))
|
||||
fireball_right.triggered.connect(_spawn_fireball.bind(Vector2.RIGHT))
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
# Get current left-right input
|
||||
var movement:float = horizontal_movement.value_axis_1d
|
||||
|
||||
# Move any dash bonus towards zero
|
||||
_dash_bonus = move_toward(_dash_bonus, 0, delta)
|
||||
|
||||
# Calculate new velocity
|
||||
velocity.x = movement * speed + _dash_bonus * dash_speed_bonus
|
||||
velocity.y = 980
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _spawn_fireball(direction:Vector2) -> void:
|
||||
# spawn a new fireball
|
||||
var fireball:Node2D = fireball_scene.instantiate()
|
||||
# add it to the tree
|
||||
get_parent().add_child(fireball)
|
||||
# start at our position/orientation
|
||||
fireball.global_transform = global_transform
|
||||
# fly into the given direction
|
||||
fireball.direction = direction
|
1
guide_examples/combos/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bd1xrcr5qu5yd
|
58
guide_examples/input_contexts/boat.gd
Normal file
@ -0,0 +1,58 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
signal exited()
|
||||
@export var speed:float = 300
|
||||
@export var turn_speed_degrees:float = 180
|
||||
|
||||
@export var context:GUIDEMappingContext
|
||||
@export var accelerate:GUIDEAction
|
||||
@export var turn:GUIDEAction
|
||||
@export var leave:GUIDEAction
|
||||
|
||||
|
||||
@onready var _player_spot:Node2D = %PlayerSpot
|
||||
@onready var _exit_spot:Node2D = %ExitSpot
|
||||
|
||||
var _player:Node2D
|
||||
|
||||
func _ready():
|
||||
leave.triggered.connect(_on_leave)
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
# rotate by our turn axis
|
||||
rotate(turn.value_axis_1d * deg_to_rad(turn_speed_degrees) * delta)
|
||||
# accelerate by our acceleration axis
|
||||
velocity = transform.x * accelerate.value_axis_1d * speed
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func enter(player:Node2D):
|
||||
# Move the player to the player spot
|
||||
_player = player
|
||||
player.reparent(_player_spot, false)
|
||||
_player.position = Vector2.ZERO
|
||||
|
||||
# And enable the boat controls
|
||||
GUIDE.enable_mapping_context(context)
|
||||
|
||||
|
||||
func _on_leave():
|
||||
# Disable boat controls
|
||||
GUIDE.disable_mapping_context(context)
|
||||
|
||||
# put player back in the world
|
||||
_player.reparent(get_parent(), false)
|
||||
_player.global_position = _exit_spot.global_position
|
||||
|
||||
# this is to prevent the physics engine from going crazy when moving
|
||||
# the player's body
|
||||
await get_tree().physics_frame
|
||||
|
||||
# notify any interested parties that the player has exited
|
||||
exited.emit()
|
||||
|
||||
|
||||
|
||||
|
||||
|
1
guide_examples/input_contexts/boat.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bkggahcvec2hd
|
10
guide_examples/input_contexts/boat.svg
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 256 192" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(1,0,0,1,-5.17241,-1.19363)">
|
||||
<path d="M23.263,34.448L23.263,159.78C23.263,159.78 147.401,167.339 177.64,157.392C207.879,147.446 251.248,92.936 251.248,92.936C251.248,92.936 206.998,44.178 178.834,36.835C141.698,27.154 23.263,34.448 23.263,34.448Z" style="fill:url(#_Linear1);stroke:rgb(51,34,18);stroke-width:8.44px;"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-6.36605,-99.8326,99.8326,-6.36605,49.1255,135.474)"><stop offset="0" style="stop-color:rgb(102,54,1);stop-opacity:1"/><stop offset="0.56" style="stop-color:rgb(87,48,5);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(30,25,19);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
37
guide_examples/input_contexts/boat.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cyqlk5nkvswx7"
|
||||
path="res://.godot/imported/boat.svg-547042152e7d4e4afdfc306682d6e571.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/input_contexts/boat.svg"
|
||||
dest_files=["res://.godot/imported/boat.svg-547042152e7d4e4afdfc306682d6e571.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
6
guide_examples/input_contexts/input_contexts.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends Node2D
|
||||
|
||||
@export var starting_context:GUIDEMappingContext
|
||||
|
||||
func _ready():
|
||||
GUIDE.enable_mapping_context(starting_context)
|
1
guide_examples/input_contexts/input_contexts.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cnf3xx5jxiu8q
|
194
guide_examples/input_contexts/input_contexts.tscn
Normal file
@ -0,0 +1,194 @@
|
||||
[gd_scene load_steps=25 format=3 uid="uid://b6h4wnjfjs70m"]
|
||||
|
||||
[ext_resource type="Script" path="res://guide_examples/input_contexts/boat.gd" id="1_61cdj"]
|
||||
[ext_resource type="Script" path="res://guide_examples/input_contexts/input_contexts.gd" id="1_386pq"]
|
||||
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="1_x61i0"]
|
||||
[ext_resource type="Texture2D" uid="uid://cyqlk5nkvswx7" path="res://guide_examples/input_contexts/boat.svg" id="1_yfaid"]
|
||||
[ext_resource type="Resource" uid="uid://bv3t73wg3atf7" path="res://guide_examples/input_contexts/mapping_contexts/boat_context.tres" id="2_ha2ml"]
|
||||
[ext_resource type="Resource" uid="uid://5jercxe6t3go" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/accelerate.tres" id="3_8s4br"]
|
||||
[ext_resource type="Script" path="res://guide_examples/input_contexts/player.gd" id="3_kn2qk"]
|
||||
[ext_resource type="Resource" uid="uid://cplpvxhus6bwb" path="res://guide_examples/input_contexts/mapping_contexts/player_context.tres" id="4_3xwjv"]
|
||||
[ext_resource type="Resource" uid="uid://qsysw0ljlj0l" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/turn.tres" id="4_w1gps"]
|
||||
[ext_resource type="Resource" uid="uid://cnaj42xnfcibo" path="res://guide_examples/input_contexts/mapping_contexts/player_actions/move.tres" id="5_70jqj"]
|
||||
[ext_resource type="Resource" uid="uid://bk2j1ww7iwqd0" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/leave.tres" id="5_typxl"]
|
||||
[ext_resource type="Resource" uid="uid://crjkk2edn8g8k" path="res://guide_examples/input_contexts/mapping_contexts/player_actions/use.tres" id="6_aiqns"]
|
||||
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="12_jcoq7"]
|
||||
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="12_u0g3a"]
|
||||
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="14_ui0u7"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w57h4"]
|
||||
size = Vector2(1972, 59)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r5hqg"]
|
||||
size = Vector2(59, 1161)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ifvju"]
|
||||
size = Vector2(2030.5, 60.5)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qarqo"]
|
||||
size = Vector2(102, 1160.5)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_la1oy"]
|
||||
size = Vector2(446.5, 1141)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3q8sb"]
|
||||
size = Vector2(368, 148)
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_54ta5"]
|
||||
radius = 75.0
|
||||
height = 252.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3lf7l"]
|
||||
size = Vector2(126, 130)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_dt2nf"]
|
||||
radius = 141.891
|
||||
|
||||
[node name="InputContexts" type="Node2D"]
|
||||
script = ExtResource("1_386pq")
|
||||
starting_context = ExtResource("4_3xwjv")
|
||||
|
||||
[node name="World" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sea" type="ColorRect" parent="World"]
|
||||
offset_right = 2009.0
|
||||
offset_bottom = 1129.0
|
||||
color = Color(0.0440738, 0.000205037, 0.549847, 1)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Land" type="Polygon2D" parent="World"]
|
||||
color = Color(0.336331, 0.394587, 0.063959, 1)
|
||||
polygon = PackedVector2Array(55, -51, 259, -24, 398, 124, 356, 225, 279, 461, 394, 656, 412, 865, 342, 1085, -15, 1119, -22, -67)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Jetty" type="ColorRect" parent="World/Land"]
|
||||
offset_left = 283.0
|
||||
offset_top = 144.0
|
||||
offset_right = 641.0
|
||||
offset_bottom = 280.0
|
||||
color = Color(0.243329, 0.15798, 7.21961e-08, 1)
|
||||
|
||||
[node name="World Boundaries" type="StaticBody2D" parent="World"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/World Boundaries"]
|
||||
position = Vector2(976, -19.5)
|
||||
shape = SubResource("RectangleShape2D_w57h4")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="World/World Boundaries"]
|
||||
position = Vector2(-10, 532)
|
||||
shape = SubResource("RectangleShape2D_r5hqg")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="World/World Boundaries"]
|
||||
position = Vector2(975.75, 1082.25)
|
||||
shape = SubResource("RectangleShape2D_ifvju")
|
||||
|
||||
[node name="CollisionShape2D4" type="CollisionShape2D" parent="World/World Boundaries"]
|
||||
position = Vector2(1940, 532.25)
|
||||
shape = SubResource("RectangleShape2D_qarqo")
|
||||
|
||||
[node name="NoBoatZone" type="StaticBody2D" parent="World"]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/NoBoatZone"]
|
||||
position = Vector2(210.75, 556.5)
|
||||
shape = SubResource("RectangleShape2D_la1oy")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="World/NoBoatZone"]
|
||||
position = Vector2(454, 211)
|
||||
shape = SubResource("RectangleShape2D_3q8sb")
|
||||
|
||||
[node name="Boat" type="CharacterBody2D" parent="."]
|
||||
position = Vector2(744, 269)
|
||||
rotation = -1.44336
|
||||
collision_layer = 5
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_61cdj")
|
||||
speed = 500.0
|
||||
context = ExtResource("2_ha2ml")
|
||||
accelerate = ExtResource("3_8s4br")
|
||||
turn = ExtResource("4_w1gps")
|
||||
leave = ExtResource("5_typxl")
|
||||
|
||||
[node name="Boat" type="Sprite2D" parent="Boat"]
|
||||
texture = ExtResource("1_yfaid")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boat"]
|
||||
position = Vector2(-13, 0)
|
||||
rotation = -1.57573
|
||||
shape = SubResource("CapsuleShape2D_54ta5")
|
||||
|
||||
[node name="PlayerSpot" type="Node2D" parent="Boat"]
|
||||
unique_name_in_owner = true
|
||||
rotation = 1.5708
|
||||
scale = Vector2(0.8, 0.8)
|
||||
|
||||
[node name="ExitSpot" type="Marker2D" parent="Boat"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-11.0732, -212.314)
|
||||
|
||||
[node name="Player" type="CharacterBody2D" parent="."]
|
||||
position = Vector2(205, 212)
|
||||
script = ExtResource("3_kn2qk")
|
||||
context = ExtResource("4_3xwjv")
|
||||
move = ExtResource("5_70jqj")
|
||||
use = ExtResource("6_aiqns")
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="Player"]
|
||||
texture = ExtResource("1_x61i0")
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape2D" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-1, 1)
|
||||
shape = SubResource("RectangleShape2D_3lf7l")
|
||||
|
||||
[node name="DetectionArea" type="Area2D" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player/DetectionArea"]
|
||||
shape = SubResource("CircleShape2D_dt2nf")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Label" type="Label" parent="UILayer"]
|
||||
offset_left = 894.0
|
||||
offset_top = 24.0
|
||||
offset_right = 1872.0
|
||||
offset_bottom = 132.0
|
||||
theme = ExtResource("12_u0g3a")
|
||||
text = "This demonstrates the use of multiple mapping contexts. We have one for the player
|
||||
and one for the boat. When the player enters the boat, the boat mappings will
|
||||
become active and will become inactive once the player leaves. "
|
||||
|
||||
[node name="BoatInstructions" type="RichTextLabel" parent="UILayer"]
|
||||
offset_left = 1316.0
|
||||
offset_top = 772.0
|
||||
offset_right = 1356.0
|
||||
offset_bottom = 812.0
|
||||
theme = ExtResource("12_u0g3a")
|
||||
script = ExtResource("14_ui0u7")
|
||||
instructions_text = "%s to accelerate/break.
|
||||
%s to turn the boat.
|
||||
%s to leave the boat."
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("3_8s4br"), ExtResource("4_w1gps"), ExtResource("5_typxl")])
|
||||
limit_to_context = ExtResource("2_ha2ml")
|
||||
|
||||
[node name="PlayerInstructions" type="RichTextLabel" parent="UILayer"]
|
||||
offset_left = 1316.0
|
||||
offset_top = 772.0
|
||||
offset_right = 1356.0
|
||||
offset_bottom = 812.0
|
||||
theme = ExtResource("12_u0g3a")
|
||||
script = ExtResource("14_ui0u7")
|
||||
instructions_text = "%s to move.
|
||||
%s to enter the boat.
|
||||
"
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("5_70jqj"), ExtResource("6_aiqns")])
|
||||
limit_to_context = ExtResource("4_3xwjv")
|
||||
|
||||
[node name="DebugLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GuideDebugger" parent="DebugLayer" instance=ExtResource("12_jcoq7")]
|
||||
theme = ExtResource("12_u0g3a")
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://5jercxe6t3go"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_tkn2p"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_tkn2p")
|
||||
name = &""
|
||||
action_value_type = 1
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bk2j1ww7iwqd0"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_3d3m7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_3d3m7")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://qsysw0ljlj0l"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_4gxp2"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_4gxp2")
|
||||
name = &""
|
||||
action_value_type = 1
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
142
guide_examples/input_contexts/mapping_contexts/boat_context.tres
Normal file
@ -0,0 +1,142 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=26 format=3 uid="uid://bv3t73wg3atf7"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://qsysw0ljlj0l" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/turn.tres" id="1_ovglr"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="2_0hduu"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="3_jicb2"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="4_ymfat"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="5_3quxn"]
|
||||
[ext_resource type="Resource" uid="uid://5jercxe6t3go" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/accelerate.tres" id="6_pocgd"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="7_1yt57"]
|
||||
[ext_resource type="Resource" uid="uid://bk2j1ww7iwqd0" path="res://guide_examples/input_contexts/mapping_contexts/boat_actions/leave.tres" id="7_t38lc"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_released.gd" id="8_f0mvl"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2l73a"]
|
||||
script = ExtResource("2_0hduu")
|
||||
key = 87
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_p26ag"]
|
||||
script = ExtResource("4_ymfat")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_2l73a")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fndx2"]
|
||||
script = ExtResource("2_0hduu")
|
||||
key = 83
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8c6p8"]
|
||||
script = ExtResource("3_jicb2")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7ubh7"]
|
||||
script = ExtResource("4_ymfat")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_fndx2")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_8c6p8")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yd1l1"]
|
||||
script = ExtResource("5_3quxn")
|
||||
action = ExtResource("6_pocgd")
|
||||
input_mappings = Array[ExtResource("4_ymfat")]([SubResource("Resource_p26ag"), SubResource("Resource_7ubh7")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_bw7vh"]
|
||||
script = ExtResource("2_0hduu")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_55txo"]
|
||||
script = ExtResource("3_jicb2")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4pm2b"]
|
||||
script = ExtResource("4_ymfat")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_bw7vh")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_55txo")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mathf"]
|
||||
script = ExtResource("2_0hduu")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_j5i1b"]
|
||||
script = ExtResource("4_ymfat")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_mathf")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_siw8f"]
|
||||
script = ExtResource("5_3quxn")
|
||||
action = ExtResource("1_ovglr")
|
||||
input_mappings = Array[ExtResource("4_ymfat")]([SubResource("Resource_4pm2b"), SubResource("Resource_j5i1b")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xiqqo"]
|
||||
script = ExtResource("2_0hduu")
|
||||
key = 69
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ooy6b"]
|
||||
script = ExtResource("8_f0mvl")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8047g"]
|
||||
script = ExtResource("4_ymfat")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_xiqqo")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_ooy6b")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_npqbc"]
|
||||
script = ExtResource("5_3quxn")
|
||||
action = ExtResource("7_t38lc")
|
||||
input_mappings = Array[ExtResource("4_ymfat")]([SubResource("Resource_8047g")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("7_1yt57")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("5_3quxn")]([SubResource("Resource_yd1l1"), SubResource("Resource_siw8f"), SubResource("Resource_npqbc")])
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cnaj42xnfcibo"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_amhrr"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_amhrr")
|
||||
name = &""
|
||||
action_value_type = 2
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://crjkk2edn8g8k"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_7lwep"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_7lwep")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,145 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=27 format=3 uid="uid://cplpvxhus6bwb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="1_126cd"]
|
||||
[ext_resource type="Resource" uid="uid://cnaj42xnfcibo" path="res://guide_examples/input_contexts/mapping_contexts/player_actions/move.tres" id="1_hm3wk"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="2_xomf3"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_input_swizzle.gd" id="3_0ask7"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="4_07e03"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="5_1myws"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="6_h3mfx"]
|
||||
[ext_resource type="Resource" uid="uid://crjkk2edn8g8k" path="res://guide_examples/input_contexts/mapping_contexts/player_actions/use.tres" id="7_dx1om"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_released.gd" id="8_hlvtj"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5yf1p"]
|
||||
script = ExtResource("2_xomf3")
|
||||
key = 87
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vo6fb"]
|
||||
script = ExtResource("3_0ask7")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ixhgx"]
|
||||
script = ExtResource("4_07e03")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pia7e"]
|
||||
script = ExtResource("5_1myws")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_5yf1p")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_vo6fb"), SubResource("Resource_ixhgx")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_a11mt"]
|
||||
script = ExtResource("2_xomf3")
|
||||
key = 83
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6ecpg"]
|
||||
script = ExtResource("3_0ask7")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_s1oiy"]
|
||||
script = ExtResource("5_1myws")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_a11mt")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_6ecpg")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_m84eo"]
|
||||
script = ExtResource("2_xomf3")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qn63o"]
|
||||
script = ExtResource("4_07e03")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4dh7v"]
|
||||
script = ExtResource("5_1myws")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_m84eo")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_qn63o")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_njvt5"]
|
||||
script = ExtResource("2_xomf3")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hvhr4"]
|
||||
script = ExtResource("5_1myws")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_njvt5")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o0rtq"]
|
||||
script = ExtResource("6_h3mfx")
|
||||
action = ExtResource("1_hm3wk")
|
||||
input_mappings = Array[ExtResource("5_1myws")]([SubResource("Resource_pia7e"), SubResource("Resource_s1oiy"), SubResource("Resource_4dh7v"), SubResource("Resource_hvhr4")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_t3oa4"]
|
||||
script = ExtResource("2_xomf3")
|
||||
key = 69
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ocal3"]
|
||||
script = ExtResource("8_hlvtj")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o528y"]
|
||||
script = ExtResource("5_1myws")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_t3oa4")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_ocal3")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0a33p"]
|
||||
script = ExtResource("6_h3mfx")
|
||||
action = ExtResource("7_dx1om")
|
||||
input_mappings = Array[ExtResource("5_1myws")]([SubResource("Resource_o528y")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_126cd")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("6_h3mfx")]([SubResource("Resource_o0rtq"), SubResource("Resource_0a33p")])
|
42
guide_examples/input_contexts/player.gd
Normal file
@ -0,0 +1,42 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var context:GUIDEMappingContext
|
||||
@export var move:GUIDEAction
|
||||
@export var use:GUIDEAction
|
||||
|
||||
@export var speed:float = 300
|
||||
|
||||
@onready var _detection_area:Area2D = %DetectionArea
|
||||
@onready var _collision_shape:CollisionShape2D = %CollisionShape
|
||||
|
||||
func _ready():
|
||||
use.triggered.connect(_enter_boat)
|
||||
|
||||
func _physics_process(_delta):
|
||||
velocity = move.value_axis_2d.normalized() * speed
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _enter_boat():
|
||||
var boats := _detection_area.get_overlapping_bodies()
|
||||
if boats.is_empty():
|
||||
return
|
||||
|
||||
# Disable player input while in the boat
|
||||
GUIDE.disable_mapping_context(context)
|
||||
|
||||
# disable our own collisions while in the boat
|
||||
_collision_shape.set_deferred("disabled", true)
|
||||
|
||||
# enter the boat
|
||||
boats[0].enter(self)
|
||||
boats[0].exited.connect(_boat_exited, CONNECT_ONE_SHOT)
|
||||
|
||||
|
||||
func _boat_exited():
|
||||
# re-enable our own mapping context
|
||||
GUIDE.enable_mapping_context(context)
|
||||
|
||||
# and re-enable our collisions
|
||||
_collision_shape.set_deferred("disabled", false)
|
||||
|
1
guide_examples/input_contexts/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bc00xf6yb6mw0
|
@ -0,0 +1,21 @@
|
||||
## This example shows how to switch the input scheme on the fly.
|
||||
extends Node
|
||||
|
||||
@export var joystick_scheme:GUIDEMappingContext
|
||||
@export var keyboard_scheme:GUIDEMappingContext
|
||||
@export var switch_to_keyboard:GUIDEAction
|
||||
@export var switch_to_joystick:GUIDEAction
|
||||
|
||||
func _ready():
|
||||
# When we get a command to switch the input scheme, we
|
||||
# switch.
|
||||
switch_to_keyboard.triggered.connect(_switch_input_scheme.bind(keyboard_scheme))
|
||||
switch_to_joystick.triggered.connect(_switch_input_scheme.bind(joystick_scheme))
|
||||
|
||||
# And switch now to enable keyboard
|
||||
_switch_input_scheme(keyboard_scheme)
|
||||
|
||||
|
||||
func _switch_input_scheme(context:GUIDEMappingContext):
|
||||
GUIDE.enable_mapping_context(context, true)
|
||||
|
@ -0,0 +1 @@
|
||||
uid://fhw2j8umfqty
|
@ -0,0 +1,60 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://dvbxt8jyo8okp"]
|
||||
|
||||
[ext_resource type="Script" path="res://guide_examples/input_scheme_switching/input_scheme_switching.gd" id="1_7l2n1"]
|
||||
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="1_t4jeg"]
|
||||
[ext_resource type="Resource" uid="uid://x33fk5wo7l2r" path="res://guide_examples/input_scheme_switching/mapping_contexts/joystick_scheme.tres" id="2_fx1v6"]
|
||||
[ext_resource type="Resource" uid="uid://2hl7iqpondhi" path="res://guide_examples/input_scheme_switching/mapping_contexts/keyboard_scheme.tres" id="3_pvyn2"]
|
||||
[ext_resource type="Resource" uid="uid://cxn2ibe1mn3sb" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/move.tres" id="4_3bnea"]
|
||||
[ext_resource type="Resource" uid="uid://b11rcmd3hse58" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/switch_to_keyboard.tres" id="4_tts5j"]
|
||||
[ext_resource type="Resource" uid="uid://c7htf8h44vbwi" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/shoot.tres" id="5_4yg1b"]
|
||||
[ext_resource type="Resource" uid="uid://vctiwgvnl0ba" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/switch_to_joystick.tres" id="6_b05vw"]
|
||||
[ext_resource type="Script" path="res://guide_examples/input_scheme_switching/player.gd" id="7_2r4ev"]
|
||||
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="8_nv6u5"]
|
||||
[ext_resource type="PackedScene" uid="uid://c36cnvgv2ur60" path="res://guide_examples/shared/fireball/fireball.tscn" id="8_t3npb"]
|
||||
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="10_vp4t3"]
|
||||
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="11_qdni4"]
|
||||
|
||||
[node name="InputSchemeSwitching" type="Node2D"]
|
||||
script = ExtResource("1_7l2n1")
|
||||
joystick_scheme = ExtResource("2_fx1v6")
|
||||
keyboard_scheme = ExtResource("3_pvyn2")
|
||||
switch_to_keyboard = ExtResource("4_tts5j")
|
||||
switch_to_joystick = ExtResource("6_b05vw")
|
||||
|
||||
[node name="Player" type="Node2D" parent="."]
|
||||
position = Vector2(929, 695)
|
||||
script = ExtResource("7_2r4ev")
|
||||
speed = 300.0
|
||||
move_action = ExtResource("4_3bnea")
|
||||
shoot_action = ExtResource("5_4yg1b")
|
||||
fireball_scene = ExtResource("8_t3npb")
|
||||
|
||||
[node name="GodotLogo" type="Sprite2D" parent="Player"]
|
||||
texture = ExtResource("1_t4jeg")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="InstructionsLabel" type="RichTextLabel" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -552.0
|
||||
offset_top = 85.0
|
||||
offset_right = -52.0
|
||||
offset_bottom = 125.0
|
||||
grow_horizontal = 0
|
||||
theme = ExtResource("10_vp4t3")
|
||||
bbcode_enabled = true
|
||||
text = "Lorem Ipsum Dolor"
|
||||
fit_content = true
|
||||
script = ExtResource("11_qdni4")
|
||||
instructions_text = "%s to move.
|
||||
%s to shoot a fireball."
|
||||
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("4_3bnea"), ExtResource("5_4yg1b")])
|
||||
|
||||
[node name="Debugger" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GuideDebugger" parent="Debugger" instance=ExtResource("8_nv6u5")]
|
||||
theme = ExtResource("10_vp4t3")
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cxn2ibe1mn3sb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_anxy1"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_anxy1")
|
||||
name = &""
|
||||
action_value_type = 2
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://c7htf8h44vbwi"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_bkoj8"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_bkoj8")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://vctiwgvnl0ba"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_8q327"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_8q327")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://b11rcmd3hse58"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_4oh0y"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_4oh0y")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,97 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=23 format=3 uid="uid://x33fk5wo7l2r"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://cxn2ibe1mn3sb" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/move.tres" id="1_hupae"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_joy_axis_2d.gd" id="2_t6p7a"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="3_6jy3p"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_deadzone.gd" id="3_c1g58"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="4_ssubt"]
|
||||
[ext_resource type="Resource" uid="uid://c7htf8h44vbwi" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/shoot.tres" id="5_pd4bb"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_joy_button.gd" id="6_eieuy"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="7_0nn3e"]
|
||||
[ext_resource type="Resource" uid="uid://b11rcmd3hse58" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/switch_to_keyboard.tres" id="8_7nlt6"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_any.gd" id="8_hdd7g"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="9_1vdw8"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7qyuq"]
|
||||
script = ExtResource("2_t6p7a")
|
||||
x = 0
|
||||
y = 1
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8pjab"]
|
||||
script = ExtResource("3_c1g58")
|
||||
lower_threshold = 0.2
|
||||
upper_threshold = 1.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wxd67"]
|
||||
script = ExtResource("3_6jy3p")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_7qyuq")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_8pjab")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lomew"]
|
||||
script = ExtResource("4_ssubt")
|
||||
action = ExtResource("1_hupae")
|
||||
input_mappings = Array[ExtResource("3_6jy3p")]([SubResource("Resource_wxd67")])
|
||||
metadata/_guide_input_mappings_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_guotu"]
|
||||
script = ExtResource("6_eieuy")
|
||||
button = 0
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ws3e0"]
|
||||
script = ExtResource("7_0nn3e")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_b21ub"]
|
||||
script = ExtResource("3_6jy3p")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_guotu")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_ws3e0")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tmt5r"]
|
||||
script = ExtResource("4_ssubt")
|
||||
action = ExtResource("5_pd4bb")
|
||||
input_mappings = Array[ExtResource("3_6jy3p")]([SubResource("Resource_b21ub")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_41j1i"]
|
||||
script = ExtResource("8_hdd7g")
|
||||
mouse_buttons = false
|
||||
mouse_movement = false
|
||||
minimum_mouse_movement_distance = 1.0
|
||||
joy_buttons = false
|
||||
joy_axes = false
|
||||
minimum_joy_axis_actuation_strength = 0.2
|
||||
keyboard = true
|
||||
touch = false
|
||||
mouse = false
|
||||
joy = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ncpby"]
|
||||
script = ExtResource("3_6jy3p")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_41j1i")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_28cwt"]
|
||||
script = ExtResource("4_ssubt")
|
||||
action = ExtResource("8_7nlt6")
|
||||
input_mappings = Array[ExtResource("3_6jy3p")]([SubResource("Resource_ncpby")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("9_1vdw8")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("4_ssubt")]([SubResource("Resource_lomew"), SubResource("Resource_tmt5r"), SubResource("Resource_28cwt")])
|
@ -0,0 +1,175 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=32 format=3 uid="uid://2hl7iqpondhi"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://cxn2ibe1mn3sb" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/move.tres" id="1_wyjhr"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="2_10ro5"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_input_swizzle.gd" id="3_uaw8o"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="4_hv31f"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="5_v5abd"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="6_5qe2r"]
|
||||
[ext_resource type="Resource" uid="uid://c7htf8h44vbwi" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/shoot.tres" id="7_diyqh"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="8_enquy"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_any.gd" id="9_j1ko4"]
|
||||
[ext_resource type="Resource" uid="uid://vctiwgvnl0ba" path="res://guide_examples/input_scheme_switching/mapping_contexts/actions/switch_to_joystick.tres" id="9_p8ck7"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="11_rkw8m"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ckatg"]
|
||||
script = ExtResource("2_10ro5")
|
||||
key = 87
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8rr5k"]
|
||||
script = ExtResource("3_uaw8o")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4c38v"]
|
||||
script = ExtResource("4_hv31f")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xot0n"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_ckatg")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_8rr5k"), SubResource("Resource_4c38v")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_v2una"]
|
||||
script = ExtResource("2_10ro5")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_tu604"]
|
||||
script = ExtResource("4_hv31f")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vh7xg"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_v2una")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_tu604")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_sko3c"]
|
||||
script = ExtResource("2_10ro5")
|
||||
key = 83
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_x4ewt"]
|
||||
script = ExtResource("3_uaw8o")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1bv7n"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_sko3c")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_x4ewt")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o6q2e"]
|
||||
script = ExtResource("2_10ro5")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ggp85"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_o6q2e")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lomew"]
|
||||
script = ExtResource("6_5qe2r")
|
||||
action = ExtResource("1_wyjhr")
|
||||
input_mappings = Array[ExtResource("5_v5abd")]([SubResource("Resource_xot0n"), SubResource("Resource_vh7xg"), SubResource("Resource_1bv7n"), SubResource("Resource_ggp85")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wxbv3"]
|
||||
script = ExtResource("2_10ro5")
|
||||
key = 32
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_a515r"]
|
||||
script = ExtResource("8_enquy")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_u0geb"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_wxbv3")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_a515r")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_f8tqv"]
|
||||
script = ExtResource("6_5qe2r")
|
||||
action = ExtResource("7_diyqh")
|
||||
input_mappings = Array[ExtResource("5_v5abd")]([SubResource("Resource_u0geb")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1wnrb"]
|
||||
script = ExtResource("9_j1ko4")
|
||||
mouse_buttons = false
|
||||
mouse_movement = false
|
||||
minimum_mouse_movement_distance = 1.0
|
||||
joy_buttons = true
|
||||
joy_axes = false
|
||||
minimum_joy_axis_actuation_strength = 0.2
|
||||
keyboard = false
|
||||
touch = false
|
||||
mouse = false
|
||||
joy = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_i18os"]
|
||||
script = ExtResource("5_v5abd")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_1wnrb")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_im7a2"]
|
||||
script = ExtResource("6_5qe2r")
|
||||
action = ExtResource("9_p8ck7")
|
||||
input_mappings = Array[ExtResource("5_v5abd")]([SubResource("Resource_i18os")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("11_rkw8m")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("6_5qe2r")]([SubResource("Resource_lomew"), SubResource("Resource_f8tqv"), SubResource("Resource_im7a2")])
|
27
guide_examples/input_scheme_switching/player.gd
Normal file
@ -0,0 +1,27 @@
|
||||
## Our player. The player has no knowledge about input schemes, it just
|
||||
## reacts to actions triggering.
|
||||
extends Node2D
|
||||
|
||||
@export var speed:float = 200
|
||||
|
||||
@export var move_action:GUIDEAction
|
||||
@export var shoot_action:GUIDEAction
|
||||
@export var fireball_scene:PackedScene
|
||||
|
||||
|
||||
func _ready():
|
||||
shoot_action.triggered.connect(_shoot_fireball)
|
||||
|
||||
|
||||
func _process(delta:float) -> void:
|
||||
position += move_action.value_axis_2d.normalized() * speed * delta
|
||||
|
||||
|
||||
func _shoot_fireball():
|
||||
var fireball = fireball_scene.instantiate()
|
||||
fireball.direction = Vector2.UP
|
||||
get_parent().add_child(fireball)
|
||||
|
||||
fireball.global_transform = global_transform
|
||||
|
||||
|
1
guide_examples/input_scheme_switching/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://csjgtlek7infj
|
16
guide_examples/mouse_position_2d/background.gd
Normal file
@ -0,0 +1,16 @@
|
||||
## This just keeps the sprite endlessly scrolling. It's not related to input.
|
||||
extends Sprite2D
|
||||
|
||||
|
||||
func _process(delta):
|
||||
# get rect of visible screen in world coordinates
|
||||
var rect = get_viewport().canvas_transform.affine_inverse() * get_viewport_rect()
|
||||
# fit the bg into the viewport
|
||||
global_position = rect.position
|
||||
global_scale = rect.size / texture.get_size()
|
||||
|
||||
# update scaling so the texture scales according to zoom level
|
||||
material.set_shader_parameter("scale", global_scale)
|
||||
var offset = rect.position / texture.get_size()
|
||||
# and offset so we pick a texture offset relative to the movement of the camera
|
||||
material.set_shader_parameter("offset", offset)
|
1
guide_examples/mouse_position_2d/background.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://by6w26jgvaitm
|
152
guide_examples/mouse_position_2d/background.svg
Normal file
@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 1920 1080" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g id="Artboard1" transform="matrix(2,0,0,2,0,0)">
|
||||
<rect x="0" y="0" width="960" height="540" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="0" y="0" width="960" height="540"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(0.5,0,0,0.5,0,0)">
|
||||
<g transform="matrix(1.24475,0,0,1.22232,-85.7788,-39.8309)">
|
||||
<rect x="68.912" y="32.586" width="772.042" height="442.599" style="fill:rgb(66,149,83);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.450896,0.307823,-0.310709,0.455124,525.083,-29.4334)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.269415,-0.157432,0.152505,0.260984,106.986,316.214)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.0120215,-0.172085,0.170625,-0.0173948,219.075,186.348)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.223981,-0.0825499,0.0885638,-0.234189,824.016,489.914)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<circle cx="159.543" cy="182.302" r="44.437" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="481.074" cy="118.528" r="19.337" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="113.93" cy="425.717" r="24.606" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="485.55" cy="307.062" r="23.813" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="840.878" cy="69.973" r="18.766" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="398.893" cy="491.121" r="20.232" style="fill:rgb(100,193,119);"/>
|
||||
<g transform="matrix(0.748773,0.662827,-0.662827,0.748773,10.3634,-112.115)">
|
||||
<rect x="122.626" y="41.18" width="53.714" height="53.714" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.965926,0.258819,-0.258819,0.965926,76.6984,-89.1342)">
|
||||
<rect x="340.345" y="210.199" width="73.05" height="73.05" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.347316,-0.451926,0.451926,0.347316,228.194,578.083)">
|
||||
<rect x="599.871" y="384.678" width="106.442" height="106.442" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.707107,0.707107,-0.707107,0.707107,376.86,-525.589)">
|
||||
<rect x="780.796" y="150.04" width="84.151" height="84.151" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(0.5,0,0,0.5,480,0)">
|
||||
<g transform="matrix(1.24475,0,0,1.22232,-85.7788,-39.8309)">
|
||||
<rect x="68.912" y="32.586" width="772.042" height="442.599" style="fill:rgb(66,149,83);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.450896,0.307823,-0.310709,0.455124,525.083,-29.4334)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.269415,-0.157432,0.152505,0.260984,106.986,316.214)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.0120215,-0.172085,0.170625,-0.0173948,219.075,186.348)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.223981,-0.0825499,0.0885638,-0.234189,824.016,489.914)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<circle cx="159.543" cy="182.302" r="44.437" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="481.074" cy="118.528" r="19.337" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="113.93" cy="425.717" r="24.606" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="485.55" cy="307.062" r="23.813" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="840.878" cy="69.973" r="18.766" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="398.893" cy="491.121" r="20.232" style="fill:rgb(100,193,119);"/>
|
||||
<g transform="matrix(0.748773,0.662827,-0.662827,0.748773,10.3634,-112.115)">
|
||||
<rect x="122.626" y="41.18" width="53.714" height="53.714" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.965926,0.258819,-0.258819,0.965926,76.6984,-89.1342)">
|
||||
<rect x="340.345" y="210.199" width="73.05" height="73.05" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.347316,-0.451926,0.451926,0.347316,228.194,578.083)">
|
||||
<rect x="599.871" y="384.678" width="106.442" height="106.442" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.707107,0.707107,-0.707107,0.707107,376.86,-525.589)">
|
||||
<rect x="780.796" y="150.04" width="84.151" height="84.151" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(0.5,0,0,0.5,0,270)">
|
||||
<g transform="matrix(1.24475,0,0,1.22232,-85.7788,-39.8309)">
|
||||
<rect x="68.912" y="32.586" width="772.042" height="442.599" style="fill:rgb(66,149,83);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.450896,0.307823,-0.310709,0.455124,525.083,-29.4334)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.269415,-0.157432,0.152505,0.260984,106.986,316.214)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.0120215,-0.172085,0.170625,-0.0173948,219.075,186.348)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.223981,-0.0825499,0.0885638,-0.234189,824.016,489.914)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<circle cx="159.543" cy="182.302" r="44.437" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="481.074" cy="118.528" r="19.337" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="113.93" cy="425.717" r="24.606" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="485.55" cy="307.062" r="23.813" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="840.878" cy="69.973" r="18.766" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="398.893" cy="491.121" r="20.232" style="fill:rgb(100,193,119);"/>
|
||||
<g transform="matrix(0.748773,0.662827,-0.662827,0.748773,10.3634,-112.115)">
|
||||
<rect x="122.626" y="41.18" width="53.714" height="53.714" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.965926,0.258819,-0.258819,0.965926,76.6984,-89.1342)">
|
||||
<rect x="340.345" y="210.199" width="73.05" height="73.05" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.347316,-0.451926,0.451926,0.347316,228.194,578.083)">
|
||||
<rect x="599.871" y="384.678" width="106.442" height="106.442" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.707107,0.707107,-0.707107,0.707107,376.86,-525.589)">
|
||||
<rect x="780.796" y="150.04" width="84.151" height="84.151" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(0.5,0,0,0.5,480,270)">
|
||||
<g transform="matrix(1.24475,0,0,1.22232,-85.7788,-39.8309)">
|
||||
<rect x="68.912" y="32.586" width="772.042" height="442.599" style="fill:rgb(66,149,83);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.450896,0.307823,-0.310709,0.455124,525.083,-29.4334)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.269415,-0.157432,0.152505,0.260984,106.986,316.214)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.0120215,-0.172085,0.170625,-0.0173948,219.075,186.348)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.223981,-0.0825499,0.0885638,-0.234189,824.016,489.914)">
|
||||
<path d="M293.435,136.432L433.806,365.61L153.064,365.61L293.435,136.432Z" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<circle cx="159.543" cy="182.302" r="44.437" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="481.074" cy="118.528" r="19.337" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="113.93" cy="425.717" r="24.606" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="485.55" cy="307.062" r="23.813" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="840.878" cy="69.973" r="18.766" style="fill:rgb(100,193,119);"/>
|
||||
<circle cx="398.893" cy="491.121" r="20.232" style="fill:rgb(100,193,119);"/>
|
||||
<g transform="matrix(0.748773,0.662827,-0.662827,0.748773,10.3634,-112.115)">
|
||||
<rect x="122.626" y="41.18" width="53.714" height="53.714" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.965926,0.258819,-0.258819,0.965926,76.6984,-89.1342)">
|
||||
<rect x="340.345" y="210.199" width="73.05" height="73.05" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.347316,-0.451926,0.451926,0.347316,228.194,578.083)">
|
||||
<rect x="599.871" y="384.678" width="106.442" height="106.442" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.707107,0.707107,-0.707107,0.707107,376.86,-525.589)">
|
||||
<rect x="780.796" y="150.04" width="84.151" height="84.151" style="fill:rgb(100,193,119);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 11 KiB |
37
guide_examples/mouse_position_2d/background.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://slnmn5k0drdb"
|
||||
path="res://.godot/imported/background.svg-2c00776905f8df1964b7da3b2242aa3e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://guide_examples/mouse_position_2d/background.svg"
|
||||
dest_files=["res://.godot/imported/background.svg-2c00776905f8df1964b7da3b2242aa3e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
19
guide_examples/mouse_position_2d/camera_2d.gd
Normal file
@ -0,0 +1,19 @@
|
||||
## Camera control. We listen to GUIDE's actions to move and zoom the camera. Note how we can
|
||||
## mix event-based and polling based input handling, depending on what works better for the
|
||||
## use case.
|
||||
extends Camera2D
|
||||
|
||||
|
||||
@export var camera_movement:GUIDEAction
|
||||
@export var camera_zoom:GUIDEAction
|
||||
@export var speed:float = 300
|
||||
|
||||
|
||||
func _ready():
|
||||
camera_zoom.triggered.connect(_zoom_camera)
|
||||
|
||||
func _process(delta):
|
||||
position += camera_movement.value_axis_2d * speed * delta
|
||||
|
||||
func _zoom_camera():
|
||||
zoom = clamp( zoom + Vector2.ONE * camera_zoom.value_axis_1d, Vector2(0.1, 0.1), Vector2(3, 3))
|
1
guide_examples/mouse_position_2d/camera_2d.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cndto72qu3boe
|
15
guide_examples/mouse_position_2d/godot_head.gd
Normal file
@ -0,0 +1,15 @@
|
||||
extends Node2D
|
||||
|
||||
@export var lifetime_seconds:float = 5.0
|
||||
var _remaining_time_seconds:float = 0
|
||||
|
||||
func _ready():
|
||||
_remaining_time_seconds = lifetime_seconds
|
||||
|
||||
func _process(delta:float) -> void:
|
||||
_remaining_time_seconds -= delta
|
||||
if _remaining_time_seconds <= 0:
|
||||
queue_free()
|
||||
return
|
||||
|
||||
modulate.a = _remaining_time_seconds / lifetime_seconds
|
1
guide_examples/mouse_position_2d/godot_head.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://c5wpkmya4n248
|
10
guide_examples/mouse_position_2d/godot_head.tscn
Normal file
@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cj8m2n32yjxka"]
|
||||
|
||||
[ext_resource type="Script" path="res://guide_examples/mouse_position_2d/godot_head.gd" id="1_7od3t"]
|
||||
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="1_1168h"]
|
||||
|
||||
[node name="GodotHead" type="Node2D"]
|
||||
script = ExtResource("1_7od3t")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_1168h")
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://ehdejslyo58y"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_clx3u"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_clx3u")
|
||||
name = &""
|
||||
action_value_type = 2
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://6dm5j1sdhdp2"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_u52q5"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_u52q5")
|
||||
name = &""
|
||||
action_value_type = 1
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://y7q516rtjlt8"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_casem"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_casem")
|
||||
name = &""
|
||||
action_value_type = 2
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://cap7r63x8tait"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action.gd" id="1_y7wt7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_y7wt7")
|
||||
name = &""
|
||||
action_value_type = 0
|
||||
block_lower_priority_actions = true
|
||||
emit_as_godot_actions = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEModifierScale" load_steps=2 format=3 uid="uid://d0brjke26hsk8"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_scale.gd" id="1_vqbea"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_vqbea")
|
||||
scale = Vector3(0.1, 1, 1)
|
||||
apply_delta_time = false
|
@ -0,0 +1,207 @@
|
||||
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=43 format=3 uid="uid://cfbk5croqnocs"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_mapping_context.gd" id="1_ru5nv"]
|
||||
[ext_resource type="Resource" uid="uid://y7q516rtjlt8" path="res://guide_examples/mouse_position_2d/mapping_contexts/actions/cursor.tres" id="1_ybilq"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_mouse_position.gd" id="2_xu301"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_input_mapping.gd" id="3_vy8se"]
|
||||
[ext_resource type="Script" path="res://addons/guide/guide_action_mapping.gd" id="4_pisoh"]
|
||||
[ext_resource type="Resource" uid="uid://ehdejslyo58y" path="res://guide_examples/mouse_position_2d/mapping_contexts/actions/camera_movement.tres" id="6_qfh27"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_key.gd" id="6_u43ni"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="7_668rf"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_input_swizzle.gd" id="8_o7tqa"]
|
||||
[ext_resource type="Script" path="res://addons/guide/inputs/guide_input_mouse_button.gd" id="10_g5tce"]
|
||||
[ext_resource type="Resource" uid="uid://cap7r63x8tait" path="res://guide_examples/mouse_position_2d/mapping_contexts/actions/spawn.tres" id="10_ohwve"]
|
||||
[ext_resource type="Script" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="11_5ifuu"]
|
||||
[ext_resource type="Script" path="res://addons/guide/modifiers/guide_modifier_canvas_coordinates.gd" id="11_j8wbm"]
|
||||
[ext_resource type="Resource" uid="uid://6dm5j1sdhdp2" path="res://guide_examples/mouse_position_2d/mapping_contexts/actions/camera_zoom.tres" id="13_htiyk"]
|
||||
[ext_resource type="Resource" uid="uid://d0brjke26hsk8" path="res://guide_examples/mouse_position_2d/mapping_contexts/modifiers/zoom_sensitivity.tres" id="14_0gubt"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_420bm"]
|
||||
script = ExtResource("2_xu301")
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hqwk3"]
|
||||
script = ExtResource("11_j8wbm")
|
||||
relative_input = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wsyf2"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_420bm")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_hqwk3")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4f0pb"]
|
||||
script = ExtResource("4_pisoh")
|
||||
action = ExtResource("1_ybilq")
|
||||
input_mappings = Array[ExtResource("3_vy8se")]([SubResource("Resource_wsyf2")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jlr8l"]
|
||||
script = ExtResource("6_u43ni")
|
||||
key = 87
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o78ws"]
|
||||
script = ExtResource("7_668rf")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8gssa"]
|
||||
script = ExtResource("8_o7tqa")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qmv1n"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_jlr8l")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_o78ws"), SubResource("Resource_8gssa")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7q6a3"]
|
||||
script = ExtResource("6_u43ni")
|
||||
key = 83
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l8svn"]
|
||||
script = ExtResource("8_o7tqa")
|
||||
order = 0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_j8u0l"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_7q6a3")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_l8svn")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_asguk"]
|
||||
script = ExtResource("6_u43ni")
|
||||
key = 65
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ly8fj"]
|
||||
script = ExtResource("7_668rf")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6m3qh"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_asguk")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_ly8fj")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vbr6o"]
|
||||
script = ExtResource("6_u43ni")
|
||||
key = 68
|
||||
shift = false
|
||||
control = false
|
||||
alt = false
|
||||
meta = false
|
||||
allow_additional_modifiers = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xiclq"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_vbr6o")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hvdyr"]
|
||||
script = ExtResource("4_pisoh")
|
||||
action = ExtResource("6_qfh27")
|
||||
input_mappings = Array[ExtResource("3_vy8se")]([SubResource("Resource_qmv1n"), SubResource("Resource_j8u0l"), SubResource("Resource_6m3qh"), SubResource("Resource_xiclq")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_3v4no"]
|
||||
script = ExtResource("10_g5tce")
|
||||
button = 4
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l152p"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_3v4no")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([ExtResource("14_0gubt")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wlhft"]
|
||||
script = ExtResource("10_g5tce")
|
||||
button = 5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_b581m"]
|
||||
script = ExtResource("7_668rf")
|
||||
x = true
|
||||
y = true
|
||||
z = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xrajm"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_wlhft")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([SubResource("Resource_b581m"), ExtResource("14_0gubt")])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_otc05"]
|
||||
script = ExtResource("4_pisoh")
|
||||
action = ExtResource("13_htiyk")
|
||||
input_mappings = Array[ExtResource("3_vy8se")]([SubResource("Resource_l152p"), SubResource("Resource_xrajm")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_w5sbr"]
|
||||
script = ExtResource("10_g5tce")
|
||||
button = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_omxoi"]
|
||||
script = ExtResource("11_5ifuu")
|
||||
actuation_threshold = 0.5
|
||||
|
||||
[sub_resource type="Resource" id="Resource_8n6aa"]
|
||||
script = ExtResource("3_vy8se")
|
||||
override_action_settings = false
|
||||
is_remappable = false
|
||||
display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_w5sbr")
|
||||
modifiers = Array[Resource("res://addons/guide/modifiers/guide_modifier.gd")]([])
|
||||
triggers = Array[Resource("res://addons/guide/triggers/guide_trigger.gd")]([SubResource("Resource_omxoi")])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_iivaa"]
|
||||
script = ExtResource("4_pisoh")
|
||||
action = ExtResource("10_ohwve")
|
||||
input_mappings = Array[ExtResource("3_vy8se")]([SubResource("Resource_8n6aa")])
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ru5nv")
|
||||
display_name = ""
|
||||
mappings = Array[ExtResource("4_pisoh")]([SubResource("Resource_4f0pb"), SubResource("Resource_hvdyr"), SubResource("Resource_otc05"), SubResource("Resource_iivaa")])
|
26
guide_examples/mouse_position_2d/mouse_position.gd
Normal file
@ -0,0 +1,26 @@
|
||||
## This example shows how to get access to the mouse cursor without being
|
||||
## specific about where the input comes from.
|
||||
extends Node2D
|
||||
|
||||
|
||||
@export var mapping_context:GUIDEMappingContext
|
||||
@export var spawn:GUIDEAction
|
||||
@export var cursor:GUIDEAction
|
||||
|
||||
@export var godot_head_scene:PackedScene
|
||||
|
||||
func _ready():
|
||||
GUIDE.enable_mapping_context(mapping_context)
|
||||
spawn.triggered.connect(_spawn_godot_head)
|
||||
|
||||
|
||||
func _spawn_godot_head():
|
||||
# Gets the mouse cursor from G.U.I.D.E. Note how the Canvas Coordinates
|
||||
# modifier automatically gives us mouse coordinates in canvas space
|
||||
# which means we don't need to take into acount the camera panning and
|
||||
# zoom level and can just use the coordinates we get to directly place
|
||||
# a Godot head at the cursor position.
|
||||
var head = godot_head_scene.instantiate()
|
||||
add_child(head)
|
||||
|
||||
head.global_position = cursor.value_axis_2d
|
1
guide_examples/mouse_position_2d/mouse_position.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cvoeomxm2dwyr
|