level select menu indicator
This commit is contained in:
parent
93656bdcfa
commit
8252ff66b8
4 changed files with 68 additions and 1 deletions
22
scripts/show_button.gd
Normal file
22
scripts/show_button.gd
Normal file
|
@ -0,0 +1,22 @@
|
|||
extends Control
|
||||
|
||||
|
||||
export var action: String
|
||||
|
||||
|
||||
onready var keyboard_button: Label = $KeyboardButton
|
||||
onready var gamepad_button: TextureRect = $GamepadButton
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if SceneManager.last_input_gamepad:
|
||||
keyboard_button.visible = false
|
||||
gamepad_button.visible = true
|
||||
var button = Controls.get_button(action)
|
||||
if button >= 0:
|
||||
gamepad_button.texture.region.position.x = float(button % 8) * 12.0
|
||||
gamepad_button.texture.region.position.y = float(button / 8) * 10.0
|
||||
else:
|
||||
keyboard_button.visible = true
|
||||
gamepad_button.visible = false
|
||||
keyboard_button.text = OS.get_scancode_string(Controls.get_key(action))
|
Loading…
Add table
Add a link
Reference in a new issue