Skip to content

feat: #1224 framework wide UI font scaling and per area scale override#1479

Open
funkosaur wants to merge 1 commit into
AlmasB:devfrom
funkosaur:feat/font-scaling
Open

feat: #1224 framework wide UI font scaling and per area scale override#1479
funkosaur wants to merge 1 commit into
AlmasB:devfrom
funkosaur:feat/font-scaling

Conversation

@funkosaur
Copy link
Copy Markdown

Description

Resolves the small-text concern raised in discussion #1224 . Made the existing fontSizeScaleUI setting actually framework-wide, and introduced three optional per-area scales on top so menus, dialogs, and notifications can each be tuned independently without affecting the rest of the UI.

Changes

  • Moved fontSizeScaleUI application into FXGLUIFactoryServiceProvider at the single font-construction chokepoint, so every piece of UI routed through getUIFactoryService() now scales: menus, buttons, mini-games, dev console, inventory, cutscenes, loading screen, plus user code that uses the factory.
  • Added three per-area scales to GameSettings, each defaulting to 1.0 and multiplied on top of fontSizeScaleUI:
    • fontSizeScaleMenu
    • fontSizeScaleDialog
    • fontSizeScaleNotification
  • Wired fontSizeScaleDialog into FXGLDialogFactoryServiceProvider.
  • Wired fontSizeScaleNotification into NotificationServiceProvider, alongside the existing fontSizeScaleUI injection, both are applied because the notification view bypasses UIFactoryService.
  • Added a fontSize: Double field to NotificationView and switched XboxNotificationView from hardcoded Font.font(18.0) to Font.font(fontSize) inside playInAnimation().
  • Added a menuScale computed property to FXGLDefaultMenu reading getSettings().fontSizeScaleMenu.
  • KDoc on each new setting documents the layering: effective_size = raw * fontSizeScaleUI * fontSizeScaleArea.

Backward-compatible: all new fields default to 1.0. Existing user code that only touches fontSizeScaleUI continues to work; what changes is that fontSizeScaleUI now affects more UI than it used to.

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.

1 participant