-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.gd
More file actions
27 lines (21 loc) · 753 Bytes
/
Copy pathMain.gd
File metadata and controls
27 lines (21 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
extends Node
# In this example the Button node has a child node that allows the sound to be played on a touch screen device.
# Note that the TouchScreenButton node is invisable.
func _process(delta):
#if an 'ui_accept' Input event occues play the sound.
if Input.is_action_just_pressed("ui_accept"):
$AudioStreamPlayer.play()
func _on_TouchScreenButton_pressed():
# This is to 'press' the event.
Input.action_press("ui_accept")
pass
func _on_TouchScreenButton_released():
# This is to 'release' the event.
Input.action_release("ui_accept")
pass
func _on_Buton_pressed():
# This is only used on testing on the desktop.
# This is not used on mobile.
Input.action_press("ui_accept")
print("pressed")
pass # Replace with function body.