Skip to content

input_hud: Divide hints between left and right margins#2096

Merged
wjt merged 1 commit intomainfrom
wjt/input-hud-divide-hints-between-left-and-right-margins
Apr 2, 2026
Merged

input_hud: Divide hints between left and right margins#2096
wjt merged 1 commit intomainfrom
wjt/input-hud-divide-hints-between-left-and-right-margins

Conversation

@wjt
Copy link
Copy Markdown
Member

@wjt wjt commented Apr 2, 2026

Using a spacer control that expands to fill any spare space in its HBox,
push some controls to the right margin. Pack everything inside a
MarginContainer to add a small amount of padding to the right-hand side.
This is because the text directly abuts the right edge of the container,
whereas on the left-hand side the icons have a bit of padding built in.
I picked the number 8 by inspecting the keyboard arrows and joypad dpad
icons, which they have 8px of margin on the left.

For normal gameplay, keep movement, running, and interact on the
left-hand side. Move repel & grapple to the right. This means that the
interact hint, which appears and disappears as you move around the
level, does not cause the position of the other actions to change.

For Sokoban, put the movement hints on the left, and the actions on the
right. Move Skip before the other two so that when it appears it does
not affect the position of the other hints. Fix a typo in the name of
the Skip node.

Access nodes by unique name, following the style documented in our
Contributing page.

https://github.com/endlessm/threadbare/wiki/Contributing#use-unique-names-to-reference-nodes-in-scripts

@wjt wjt requested a review from a team as a code owner April 2, 2026 09:32
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/input-hud-divide-hints-between-left-and-right-margins/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

Copy link
Copy Markdown
Collaborator

@manuq manuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in the web build. Nice improvement! I note that:

  • The hints are over the version number when the Pause overlay is visible. Maybe the PauseOverlay autoload should be moved above the InputHud autoload.
  • The hints at the right side of the screen need a margin, so words "Throw" or "Repel" don't appear at the border of the viewport.
Image Image

@onready var throw_input_hint: HBoxContainer = $TabContainer/NormalControls/ThrowInputHint
@onready var sokoban_controls: HBoxContainer = $TabContainer/SokobanControls
@onready var skip_input_hint: HBoxContainer = $TabContainer/SokobanControls/SkiptInputHint
@onready var skip_input_hint: HBoxContainer = $TabContainer/SokobanControls/SkipInputHint
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo addressed!

[node name="RepelInputHint" parent="TabContainer/NormalControls" unique_id=1938432601 instance=ExtResource("3_xu7en")]
visible = false
[node name="Spacer" type="Control" parent="TabContainer/NormalControls" unique_id=1059909765]
editor_description = "This empty control expands to fill the center of the hbox, pushing any controls packed after it to the right margin."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wjt
Copy link
Copy Markdown
Member Author

wjt commented Apr 2, 2026

Good point. The hints also appear above the scene transition fade - I was planning to address that separately, but hadn't spotted the pause menu has the same issue.

I also want to hide them during dialogue!

@wjt
Copy link
Copy Markdown
Member Author

wjt commented Apr 2, 2026

I'll add a margin in this PR and open a follow-up for hide during pause etc.

@wjt wjt force-pushed the wjt/input-hud-divide-hints-between-left-and-right-margins branch from 515e593 to abbe09b Compare April 2, 2026 10:05
@wjt wjt changed the title input_hud: Divide hints between left and right margins [1/1] input_hud: Divide hints between left and right margins Apr 2, 2026
Using a spacer control that expands to fill any spare space in its HBox,
push some controls to the right margin. Pack everything inside a
MarginContainer to add a small amount of padding to the right-hand side.
This is because the text directly abuts the right edge of the container,
whereas on the left-hand side the icons have a bit of padding built in.
I picked the number 8 by inspecting the keyboard arrows and joypad dpad
icons, which they have 8px of margin on the left.

For normal gameplay, keep movement, running, and interact on the
left-hand side. Move repel & grapple to the right. This means that the
interact hint, which appears and disappears as you move around the
level, does not cause the position of the other actions to change.

For Sokoban, put the movement hints on the left, and the actions on the
right. Move Skip before the other two so that when it appears it does
not affect the position of the other hints. Fix a typo in the name of
the Skip node.

Access nodes by unique name, following the style documented in our
Contributing page.

https://github.com/endlessm/threadbare/wiki/Contributing#use-unique-names-to-reference-nodes-in-scripts
@wjt wjt force-pushed the wjt/input-hud-divide-hints-between-left-and-right-margins branch from abbe09b to a1977fd Compare April 2, 2026 10:05
@wjt wjt changed the title [1/1] input_hud: Divide hints between left and right margins input_hud: Divide hints between left and right margins Apr 2, 2026
@wjt wjt merged commit 66bde7d into main Apr 2, 2026
6 checks passed
@wjt wjt deleted the wjt/input-hud-divide-hints-between-left-and-right-margins branch April 2, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants