forked from team-sg/hero-mark-2
added sound test
This commit is contained in:
parent
79667b593c
commit
f14e8ebdd0
21 changed files with 734 additions and 2 deletions
23
menus/music_select.gd
Normal file
23
menus/music_select.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
extends TextureButton
|
||||
|
||||
export (Array, String) var titles
|
||||
export (Array, AudioStream) var songs
|
||||
var current_selection = 0
|
||||
onready var body = $MusicLabel/Label
|
||||
|
||||
func _ready():
|
||||
call_deferred("grab_focus")
|
||||
|
||||
func _gui_input(event):
|
||||
if Input.is_action_just_pressed("ui_left"):
|
||||
current_selection -= 1
|
||||
if Input.is_action_just_pressed("ui_right"):
|
||||
current_selection += 1
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
Audio.play_sound(songs[current_selection],Audio.ac_music)
|
||||
if Input.is_action_just_pressed("ui_cancel"):
|
||||
Audio.ac_music.stop()
|
||||
current_selection = posmod(current_selection,songs.size())
|
||||
body.text = titles[current_selection]
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue