Adding custom cursor
This commit is contained in:
parent
822336ab56
commit
eae131ad08
12 changed files with 91 additions and 13 deletions
|
|
@ -15,3 +15,4 @@ stream = ExtResource("2_hixh2")
|
|||
volume_db = 2.385
|
||||
|
||||
[connection signal="button_down" from="." to="." method="_on_button_down"]
|
||||
[connection signal="button_up" from="." to="." method="_on_button_release"]
|
||||
|
|
|
|||
|
|
@ -352,6 +352,7 @@ animations = [{
|
|||
script = ExtResource("1_dsoqt")
|
||||
|
||||
[node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_5k0jt")
|
||||
animation = &"Idle"
|
||||
autoplay = "Idle"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ timer = NodePath("BidDelayTimer")
|
|||
[node name="Chairs" type="Node2D" parent="."]
|
||||
|
||||
[node name="ChairsBack" type="Sprite2D" parent="Chairs"]
|
||||
texture_filter = 1
|
||||
position = Vector2(640, 360)
|
||||
texture = ExtResource("2_rhx06")
|
||||
|
||||
|
|
@ -19,15 +20,25 @@ texture = ExtResource("2_rhx06")
|
|||
one_shot = true
|
||||
|
||||
[node name="ArtCollector" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(182, 135)
|
||||
position = Vector2(182, 134)
|
||||
|
||||
[node name="ArtCollector2" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(415, 135)
|
||||
position = Vector2(408, 136)
|
||||
|
||||
[node name="ArtCollector3" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(668, 135)
|
||||
position = Vector2(580, 135)
|
||||
|
||||
[node name="ArtCollector8" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(740, 134)
|
||||
|
||||
[node name="ArtCollector6" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(490, 132)
|
||||
|
||||
[node name="ArtCollector11" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(343, 135)
|
||||
|
||||
[node name="ChairsFront" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(640, 360)
|
||||
texture = ExtResource("4_mrkjv")
|
||||
|
||||
|
|
@ -35,4 +46,13 @@ texture = ExtResource("4_mrkjv")
|
|||
position = Vector2(252, 157)
|
||||
|
||||
[node name="ArtCollector5" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(589, 157)
|
||||
position = Vector2(589, 158)
|
||||
|
||||
[node name="ArtCollector9" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(669, 158)
|
||||
|
||||
[node name="ArtCollector10" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(328, 158)
|
||||
|
||||
[node name="ArtCollector7" parent="." instance=ExtResource("3_rhx06")]
|
||||
position = Vector2(420, 158)
|
||||
|
|
|
|||
|
|
@ -6,16 +6,36 @@ signal auctioneer_bark
|
|||
|
||||
func _on_great_buy_button_down() -> void:
|
||||
auctioneer_bark.emit()
|
||||
$GreatBuy.mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
DisplayServer.tts_speak("Great buy!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
|
||||
|
||||
func _on_investment_piece_button_down() -> void:
|
||||
auctioneer_bark.emit()
|
||||
$InvestmentPiece.mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
DisplayServer.tts_speak("Investment piece!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
|
||||
|
||||
func _on_stunning_message_button_down() -> void:
|
||||
auctioneer_bark.emit()
|
||||
$StunningMessage.mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
DisplayServer.tts_speak("Stunning message!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
|
||||
|
||||
func _on_innovative_artist_button_down() -> void:
|
||||
auctioneer_bark.emit()
|
||||
$InnovativeArtist.mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
DisplayServer.tts_speak("Innovative artist!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
|
||||
|
||||
|
||||
func _on_great_buy_button_release() -> void:
|
||||
$GreatBuy.mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
||||
|
||||
func _on_investment_piece_button_up() -> void:
|
||||
$InvestmentPiece.mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
||||
|
||||
func _on_stunning_message_button_release() -> void:
|
||||
$StunningMessage.mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
||||
|
||||
func _on_innovative_artist_button_release() -> void:
|
||||
$InnovativeArtist.mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
extends Node
|
||||
extends Control
|
||||
|
||||
var hover = load("res://assets/cursor/cursor_open.png")
|
||||
var click = load("res://assets/cursor/cursor_closed.png")
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_custom_mouse_cursor(hover)
|
||||
|
||||
# need to find the correct cursor mode for changing on click
|
||||
Input.set_custom_mouse_cursor(click, Input.CURSOR_DRAG)
|
||||
#Input.set_custom_mouse_cursor(hover)
|
||||
Input.set_custom_mouse_cursor(hover, Input.CURSOR_ARROW, Vector2(30, 15))
|
||||
|
||||
#Input.set_custom_mouse_cursor(click, Input.CURSOR_DRAG)
|
||||
Input.set_custom_mouse_cursor(click, Input.CURSOR_DRAG, Vector2(42, 24))
|
||||
|
||||
#func _input(event: InputEvent) -> void:
|
||||
#if event is InputEventMouseButton and event.is_pressed():
|
||||
##Input.set_custom_mouse_cursor(click)
|
||||
##Input.set_default_cursor_shape(Input.CURSOR_IBEAM)
|
||||
#mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
#elif event is InputEventMouseButton and not event.is_pressed():
|
||||
##Input.set_custom_mouse_cursor(hover)
|
||||
#mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
|
|
|||
|
|
@ -2,5 +2,10 @@
|
|||
|
||||
[ext_resource type="Script" uid="uid://dds738kgqrpux" path="res://cursor_manager.gd" id="1_vunjj"]
|
||||
|
||||
[node name="CursorManager" type="Node"]
|
||||
[node name="CursorManager" type="Control"]
|
||||
custom_minimum_size = Vector2(1280, 720)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
mouse_filter = 2
|
||||
mouse_behavior_recursive = 1
|
||||
script = ExtResource("1_vunjj")
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ stream = ExtResource("5_ky68s")
|
|||
volume_db = 3.0
|
||||
|
||||
[node name="GavelAnimations" type="AnimatedSprite2D" parent="Gavel"]
|
||||
texture_filter = 1
|
||||
position = Vector2(240, 210)
|
||||
sprite_frames = SubResource("SpriteFrames_g470s")
|
||||
animation = &"Press"
|
||||
|
|
@ -186,6 +187,7 @@ error_audio_player = NodePath("ErrorSoundPlayer")
|
|||
success_audio_player = NodePath("SuccessSoundPlayer")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Numpad"]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("5_r8wvv")
|
||||
|
||||
[node name="0" parent="Numpad" instance=ExtResource("3_se7ci")]
|
||||
|
|
@ -316,5 +318,6 @@ theme_type_variation = &"Red"
|
|||
show_percentage = false
|
||||
|
||||
[connection signal="button_down" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_button_down"]
|
||||
[connection signal="button_up" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_button_release"]
|
||||
[connection signal="mouse_entered" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_mouse_exited"]
|
||||
|
|
|
|||
5
gavel.gd
5
gavel.gd
|
|
@ -29,6 +29,7 @@ var swing_start = Vector2(0, 0)
|
|||
|
||||
|
||||
func _on_texture_button_button_down() -> void:
|
||||
$TextureButton.mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
audio_player.play()
|
||||
gavel_hit.emit()
|
||||
$GavelAnimations.play("Press")
|
||||
|
|
@ -44,3 +45,7 @@ func _on_texture_button_mouse_exited() -> void:
|
|||
#else:
|
||||
#$GavelAnimations.play("Hover", -1.0)
|
||||
#$GavelAnimations.play("Idle")
|
||||
|
||||
|
||||
func _on_texture_button_button_release() -> void:
|
||||
$TextureButton.mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ default_font_size = 12
|
|||
[node name="Main" type="Node"]
|
||||
|
||||
[node name="Background" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(640, 360)
|
||||
texture = ExtResource("1_lquwl")
|
||||
|
||||
|
|
@ -145,6 +146,10 @@ volume_db = -14.0
|
|||
autoplay = true
|
||||
|
||||
[connection signal="button_down" from="BarkButtons/GreatBuy" to="BarkButtons" method="_on_great_buy_button_down"]
|
||||
[connection signal="button_up" from="BarkButtons/GreatBuy" to="BarkButtons" method="_on_great_buy_button_release"]
|
||||
[connection signal="button_down" from="BarkButtons/InvestmentPiece" to="BarkButtons" method="_on_investment_piece_button_down"]
|
||||
[connection signal="button_up" from="BarkButtons/InvestmentPiece" to="BarkButtons" method="_on_investment_piece_button_up"]
|
||||
[connection signal="button_down" from="BarkButtons/StunningMessage" to="BarkButtons" method="_on_stunning_message_button_down"]
|
||||
[connection signal="button_up" from="BarkButtons/StunningMessage" to="BarkButtons" method="_on_stunning_message_button_release"]
|
||||
[connection signal="button_down" from="BarkButtons/InnovativeArtist" to="BarkButtons" method="_on_innovative_artist_button_down"]
|
||||
[connection signal="button_up" from="BarkButtons/InnovativeArtist" to="BarkButtons" method="_on_innovative_artist_button_release"]
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ grow_vertical = 2
|
|||
script = ExtResource("1_glbon")
|
||||
|
||||
[node name="Background" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(640, 360)
|
||||
texture = ExtResource("1_06t4h")
|
||||
|
||||
|
|
@ -51,5 +52,5 @@ texture = ExtResource("3_glbon")
|
|||
[node name="MenuMusic" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("4_jix8l")
|
||||
volume_db = -14.0
|
||||
volume_db = -7.697
|
||||
autoplay = true
|
||||
|
|
|
|||
|
|
@ -14,10 +14,14 @@ func _ready() -> void:
|
|||
|
||||
func _on_button_down() -> void:
|
||||
audio_player.play()
|
||||
|
||||
mouse_default_cursor_shape = Control.CURSOR_DRAG
|
||||
|
||||
if button_value <= 9:
|
||||
parent.keypad_entry(button_value)
|
||||
elif button_value == 10:
|
||||
parent.keypad_backspace()
|
||||
else:
|
||||
parent.keypad_submit()
|
||||
|
||||
func _on_button_release() -> void:
|
||||
mouse_default_cursor_shape = Control.CURSOR_ARROW
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bnb1i0y0fls7b"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bnb1i0y0fls7b"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://q1x5v4q6uxsj" path="res://main_menu.tscn" id="1_f3sb7"]
|
||||
[ext_resource type="Script" uid="uid://btq5lp33qphwg" path="res://world.gd" id="1_fj7yv"]
|
||||
[ext_resource type="PackedScene" uid="uid://6a4hl2twv0lj" path="res://cursor_manager.tscn" id="2_tlwt5"]
|
||||
|
||||
[node name="World" type="Control"]
|
||||
layout_mode = 3
|
||||
|
|
@ -12,5 +13,7 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
script = ExtResource("1_fj7yv")
|
||||
|
||||
[node name="CursorManager" parent="." instance=ExtResource("2_tlwt5")]
|
||||
|
||||
[node name="MainMenu" parent="." instance=ExtResource("1_f3sb7")]
|
||||
layout_mode = 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue