touch controls and hud
This commit is contained in:
@@ -119,7 +119,11 @@ func _build_bottom_hud() -> void:
|
||||
# Bull-head plate that sits behind the ability + health cluster. It's a sibling of the
|
||||
# cluster (not a parent) so it never constrains the cluster's layout; we size and place
|
||||
# it against the cluster's rect in _position_bull_bg.
|
||||
# Skipped on touch/phone: the on-screen thumb cluster already crowds the bottom edge, so
|
||||
# the wide horned plate just adds clutter there.
|
||||
func _build_bull_hud_bg() -> void:
|
||||
if Controls.use_touch_ui():
|
||||
return
|
||||
_bull_bg = TextureRect.new()
|
||||
if ResourceLoader.exists(_BULL_BG):
|
||||
_bull_bg.texture = load(_BULL_BG)
|
||||
@@ -240,7 +244,13 @@ func _toggle_controls() -> void:
|
||||
# joystick and ability buttons instead. Shares Controls.use_touch_ui() with that
|
||||
# overlay so exactly one control scheme shows on any given device.
|
||||
func _update_control_hints() -> void:
|
||||
if _game_over or Controls.use_touch_ui():
|
||||
var touch := Controls.use_touch_ui()
|
||||
# The desktop tiles carry keyboard keycaps that mean nothing on a phone, and their
|
||||
# STOP-filtered panels would sit over the joystick zone eating touches — touch_controls
|
||||
# shows its own ability buttons instead, so drop the desktop bar on touch devices.
|
||||
if _ability_bar != null:
|
||||
_ability_bar.visible = not touch
|
||||
if _game_over or touch:
|
||||
_controls_panel.visible = false
|
||||
_tab_hint.visible = false
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user