Tooltips reworked

This commit is contained in:
2023-02-14 23:58:49 +01:00
parent 61b53578d0
commit 8ec360bb42
8 changed files with 232 additions and 14 deletions

View File

@@ -0,0 +1,34 @@
extends CollisionPolygon2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_mouse_entered():
$AnimatedSprite3.play()
func _on_mouse_exited():
$AnimatedSprite3.stop()
func _on_Area2D_mouse_entered():
$AnimatedSprite3.play()
func _on_Area2D_mouse_exited():
$AnimatedSprite3.stop()
func _on_TextureRect_mouse_entered():
$AnimatedSprite3.play()

View File

@@ -2,4 +2,6 @@
say player "Parece que veo a Mikel"
:action2
say player "Esta cerrada por dentro."
#say player "Esta cerrada por dentro."
play_snd res://game/sfx/sounds/doorOpen_2.ogg
change_scene "res://gymkhana/rooms/home/home.tscn"

View File

@@ -0,0 +1,5 @@
:action1
say player "Es naranja"
:action2
say player "Pesa demasiado!"

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=28 format=2]
[gd_scene load_steps=32 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=3]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=4]
[ext_resource path="res://gymkhana/rooms/trasera_cocina/HoverStartAnimation.gd" type="Script" id=5]
[ext_resource path="res://gymkhana/rooms/trasera_cocina/assets/background trasera cocina-pix.png" type="Texture" id=6]
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=8]
@@ -25,6 +26,9 @@
[ext_resource path="res://gymkhana/rooms/trasera_cocina/assets/eneko-anim/unscreen-008.png" type="Texture" id=24]
[ext_resource path="res://gymkhana/rooms/trasera_cocina/assets/columna.png" type="Texture" id=25]
[ext_resource path="res://gymkhana/rooms/trasera_cocina/assets/background trasera cocina-pix-height.png" type="Texture" id=26]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/item.gd" type="Script" id=27]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/tooltip-reworked/tooltip-action2.tscn" type="PackedScene" id=28]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/tooltip-reworked/tooltip-action1.tscn" type="PackedScene" id=29]
[sub_resource type="SpriteFrames" id=2]
animations = [ {
@@ -56,19 +60,11 @@ mouse_filter = 2
texture = ExtResource( 6 )
script = ExtResource( 2 )
[node name="AnimatedSprite3" type="AnimatedSprite" parent="."]
position = Vector2( 643, 359 )
scale = Vector2( 0.752992, 0.752993 )
frames = SubResource( 2 )
frame = 5
playing = true
offset = Vector2( -0.09375, 20.0582 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( 1476, 363 )
scale = Vector2( 0.634168, 0.634168 )
frames = SubResource( 2 )
frame = 8
frame = 11
playing = true
flip_h = true
@@ -76,7 +72,7 @@ flip_h = true
position = Vector2( 1018, 333 )
scale = Vector2( 0.867751, 0.867751 )
frames = SubResource( 2 )
frame = 7
frame = 10
playing = true
offset = Vector2( -0.09375, 20.0582 )
@@ -103,6 +99,7 @@ global_id = "l_exit"
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/entrada_cocina.esc"
is_exit = true
tooltip_name = "Esto es una puerta"
tooltip2_name = "Entrar!"
default_action = "action2"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
@@ -122,3 +119,60 @@ position = Vector2( 253.25, 294.5 )
scale = Vector2( 0.973684, 1.02358 )
z_index = 400
texture = ExtResource( 25 )
[node name="TextureRect" type="TextureRect" parent="."]
margin_left = 598.0
margin_top = 283.0
margin_right = 692.0
margin_bottom = 464.0
[node name="Area2D" type="Area2D" parent="."]
position = Vector2( 598, 283 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Area2D"]
polygon = PoolVector2Array( 15, 112, 29, 118, 31, 147, 29, 181, 56, 186, 63, 174, 81, 186, 105, 185, 95, 156, 102, 112, 92, 89, 94, 50, 79, 27, 69, 17, 42, -4, 32, 19, 20, 31, 0, 71, 18, 86 )
script = ExtResource( 5 )
[node name="AnimatedSprite3" type="AnimatedSprite" parent="Area2D/CollisionPolygon2D"]
position = Vector2( 53, 77 )
scale = Vector2( 0.752992, 0.752993 )
frames = SubResource( 2 )
offset = Vector2( -0.09375, 20.0582 )
[node name="TextureRect" type="TextureRect" parent="Area2D"]
margin_right = 40.0
margin_bottom = 40.0
[node name="I_Bombona" type="Area2D" parent="."]
pause_mode = 1
position = Vector2( 557, 408 )
script = ExtResource( 27 )
global_id = "i_bombona"
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona.esc"
default_action = "action1"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
action1_text = "Mirar bombona"
action2_text = "Coger bombona"
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="I_Bombona"]
polygon = PoolVector2Array( -13, -19, -14, -3, -15, 30, -4, 34, 10, 32, 20, 29, 22, 16, 22, -6, 21, -19, 12, -28, 1, -28 )
[node name="action1" parent="I_Bombona" instance=ExtResource( 29 )]
position = Vector2( -53, -48 )
[node name="action2" parent="I_Bombona" instance=ExtResource( 28 )]
position = Vector2( -13, 51 )
[node name="ESCLocation" type="Position2D" parent="I_Bombona"]
position = Vector2( -65, 57 )
script = ExtResource( 3 )
[connection signal="mouse_entered" from="TextureRect" to="Area2D/CollisionPolygon2D" method="_on_TextureRect_mouse_entered"]
[connection signal="mouse_entered" from="Area2D" to="Area2D/CollisionPolygon2D" method="_on_Area2D_mouse_entered"]
[connection signal="mouse_exited" from="Area2D" to="Area2D/CollisionPolygon2D" method="_on_Area2D_mouse_exited"]
[connection signal="mouse_entered" from="I_Bombona" to="I_Bombona/action1" method="_on_ESCItemWithTooltip_mouse_entered"]
[connection signal="mouse_entered" from="I_Bombona" to="I_Bombona/action2" method="_on_ESCItemWithTooltip_mouse_entered"]
[connection signal="mouse_exited" from="I_Bombona" to="I_Bombona/action1" method="_on_ESCItemWithTooltip_mouse_exited"]
[connection signal="mouse_exited" from="I_Bombona" to="I_Bombona/action2" method="_on_ESCItemWithTooltip_mouse_exited"]