Skip to content

HUD hint buttons: Project shadow for better contrast#2167

Open
manuq wants to merge 2 commits intomainfrom
hud-hints-contrast
Open

HUD hint buttons: Project shadow for better contrast#2167
manuq wants to merge 2 commits intomainfrom
hud-hints-contrast

Conversation

@manuq
Copy link
Copy Markdown
Collaborator

@manuq manuq commented May 7, 2026

Use the same offset and color than the text label shadow.

Mouse and keyboard atlas: Remove rectangle of solid pixels

Which actually don't contain any icons. Because when cropping slices of this
atlas right below this area, the drop shadow shader does drop a shadow for the
pixels above.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Play this branch at https://play.threadbare.game/branches/endlessm/hud-hints-contrast/.

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

@manuq
Copy link
Copy Markdown
Collaborator Author

manuq commented May 7, 2026

@wjt I remember we got feedback on having a better contrast in the HUD some time ago. I think it was in Discord. We could do the change in the assets themselves. Here I did it with a shader, at least for a quick try.

image

Use the same offset and color than the text label shadow.
@manuq manuq force-pushed the hud-hints-contrast branch from c429626 to 7b04087 Compare May 7, 2026 15:49
@manuq manuq marked this pull request as ready for review May 7, 2026 15:51
@manuq manuq requested a review from a team as a code owner May 7, 2026 15:51
@manuq
Copy link
Copy Markdown
Collaborator Author

manuq commented May 7, 2026

This is how hints on the right side look:

Captura desde 2026-05-07 12-58-07

There is a problem with the mouse hint, it is projecting shadow at the top border:

Captura desde 2026-05-07 12-59-13

The region is correct, I think. But the texture has pixels painted above. One way to fix it is by making those unused pixels transparent:

Captura desde 2026-05-07 12-53-22

Which actually don't contain any icons. Because when cropping slices of this
atlas right below this area, the drop shadow shader does drop a shadow for the
pixels above.
@manuq
Copy link
Copy Markdown
Collaborator Author

manuq commented May 7, 2026

Fixed by just removing the solid rectangle from the atlas asset:

image

@wjt
Copy link
Copy Markdown
Member

wjt commented May 7, 2026

I think I saw another way to avoid this oversampling of the texture - let me check.

@wjt
Copy link
Copy Markdown
Member

wjt commented May 7, 2026

Found it. AtlasTexture has a filter_clip property:

image

I think that would work. But maybe it has a cost; and just deleting the extraneous pixels also works.

@manuq
Copy link
Copy Markdown
Collaborator Author

manuq commented May 7, 2026

Found it. AtlasTexture has a filter_clip property:

Oh good to know!

image I think that would work. But maybe it has a cost; and just deleting the extraneous pixels also works.

As you wish. I can revert the texture change. But yes we really don't need those pixels.

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