#41: menus and settings at phone scale
On phones the main menu, pause menu, question box, and settings fit the scaled canvas inside the safe area, with buttons and rows at least 44 pt tall (19.5:9 at 1.6x, the iPhone SE at the 1.7 cap, 4:3 iPads). The pause menu puts its buttons in a column beside the rest. Phone settings: Audio, Touch (Interface size, Swap sticks, Camera distance, Haptics, and a short touch-controls guide), Display (3D resolution scale), and Gameplay. The list scrolls by dragging, and a slider only moves after a mostly sideways drag. GameSettings saves the touch settings under [touch] and applies them live (&"touch_controls", the follow camera on phones). A hit buzzes the phone with Haptics on. Desktop menus are unchanged. Test: game/tests/mobile/menus_test.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5392ae09af
commit
0c401171f3
10 changed files with 1139 additions and 46 deletions
|
|
@ -4,10 +4,13 @@ extends Camera3D
|
|||
## Angled top-down camera that trails a target. The framing comes entirely from pitch / yaw /
|
||||
## distance (the transform is overwritten every frame, also in the editor so the framing can be
|
||||
## previewed). PlayerCharacter moves relative to this camera's yaw. Mouse wheel zooms. On a phone
|
||||
## (MobilePort) it starts closer, at PHONE_DISTANCE.
|
||||
## (MobilePort) it starts closer, at PHONE_DISTANCE, and then sits at the Camera distance setting
|
||||
## (GameSettings.apply_touch finds it through GROUP).
|
||||
|
||||
## The phones' distance (the small screen), in place of distance's default when the game starts.
|
||||
const PHONE_DISTANCE := 12.0
|
||||
## Every follow camera is in this group, for the settings.
|
||||
const GROUP := &"follow_camera"
|
||||
|
||||
@export var target: Node3D
|
||||
@export_range(5.0, 89.0) var pitch_deg := 50.0
|
||||
|
|
@ -26,6 +29,7 @@ var _focus := Vector3.ZERO
|
|||
|
||||
func _ready() -> void:
|
||||
physics_interpolation_mode = Node.PHYSICS_INTERPOLATION_MODE_OFF
|
||||
add_to_group(GROUP)
|
||||
if not Engine.is_editor_hint() and MobilePort.active():
|
||||
distance = PHONE_DISTANCE
|
||||
snap_to_target()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue