Skip to content

UI Scaling - #126

Open
mightbemyname wants to merge 2 commits into
eriknihlen:mainfrom
mightbemyname:feature/ui-scale
Open

mightbemyname wants to merge 2 commits into
eriknihlen:mainfrom
mightbemyname:feature/ui-scale

Conversation

@mightbemyname

Copy link
Copy Markdown

Summary

  • Add a persistent UI Scale option in Input Options, from 50% to 300% in 10% steps.
  • Scale gameplay frames, text, and controls together so the UI is legible on high-resolution displays.

Testing

  • Release solution build passed with zero warnings or errors.
  • All 14 projects in the documented portable test gate passed.
  • Published a Windows client build for in-game verification.

This is an optional accessibility/display setting; the default remains 100%.

@mightbemyname mightbemyname changed the title Feature/UI scale UI Scaling Sep 16, 2026

@eriknihlen eriknihlen left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for a good PR!
Ok some issues, two blockers:

  1. If you scale below 90 % the dropdown menus break. Either don't scale below 100 % or fix that.
  2. Target indicator in monsters behaves weird when scale is 150 %. That needs fixing.** Claude also said this regarding this:

_"The vivid target indicator is the bracket drawn around the creature you have selected. To place it, the code projects the creature's 3-D position onto the screen and gets a pixel coordinate, say (1200, 600) on a 1920×1080 window. It then writes that number straight into the bracket's UI position.

With PR #126, every UI element's position is multiplied by the scale when drawn. At 150% the bracket at (1200, 600) is drawn at (1800, 900). The creature is still at pixel (1200, 600), because the 3-D scene is not scaled. So the bracket sits 600 pixels right and 300 pixels down from the creature.

The error is proportional to the distance from the top-left corner, which is why it is worse toward the bottom-right. A creature at the very top-left corner would still be framed correctly.

The fix is one line: divide the projected coordinate by the scale before handing it to the UI, so the draw-time multiply brings it back to the real pixel._

It also had some comments, more polish: (nothing I noted)
_Creature preview is soft. The examine window shows the creature rendered into a small off-screen image, then draws that image inside the window. The image size comes from the window's size in UI units. At 200% the window is drawn twice as big on screen but the image is still made at the small size, so it is stretched up and looks blurry. Fix: make the image at the size times the scale.

Half-pixels at odd scales. At 110% a 100-pixel wide element becomes 110 pixels, fine. But a border piece at position 37 becomes 40.7. The GPU blends that across two pixels, so edges look fuzzy and the joins between window-border pieces show thin gaps or overlaps. Rounding every scaled position to a whole pixel avoids it. At exactly 200% or 300% there are no fractions, but the PR also switches to smooth texture filtering for any scale other than 100%, so those are blurred too when they need not be.

Setting stored in the wrong place. The UI scale is saved inside the chat section of the settings file. It has nothing to do with chat. Once users have files with it there, moving it means a migration, so better to put it in the right place before merging.

Shared slider code changed. To make the new slider work, the author changed a helper that all numeric sliders share, including the two audio volume sliders and the render-pack settings. The reviewer traced it and thinks it is harmless, but no test covers those sliders, so a regression there would go unnoticed._

This branch has not been deployed

No deployments
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