Reserve the UI bar height when scaling the game area - #37
Open
soulrap wants to merge 1 commit into
Open
Conversation
The game area and the UI bar are laid out in two design boxes that happen to share the same 1.78 ratio - the board in the game's `mainSizesMap` (1422x800 for scatter), the bar in `STANDARD_MAIN_SIZES_MAP` (1920x1080), bottom-aligned via `<MainContainer standard alignVertical="bottom">`. Once the canvas is wider than that ratio the height binds for both. The board takes the full canvas height and centres; the bar is anchored to the bottom of the same canvas; the bottom row of the board renders behind it. Reproduced on scatter at 1194x518 (ratio 2.31) - the last symbol row is completely covered. At 984x858 (ratio 1.15) width binds instead and there is no overlap, which is why this is easy to miss on a normal desktop window. Add an optional `safeAreaBottomMap` to `createLayout`. The reserved strip is subtracted before the scale is derived, and the game area centres in what is left rather than in the whole canvas. It defaults to 0, so a layout that does not set it produces identical numbers to before. scatter opts in here as a worked example. The other five samples have the same latent overlap and can adopt it with their own values. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The game area and the UI bar are laid out in two design boxes that happen to share the same 1.78 ratio - the board in the game's
mainSizesMap(1422x800 for scatter), the bar inSTANDARD_MAIN_SIZES_MAP(1920x1080), bottom-aligned via<MainContainer standard alignVertical=bottom>. Once the canvas is wider than that ratio the height binds for both. The board takes the full canvas height and centres; the bar is anchored to the bottom of the same canvas; the bottom row of the board renders behind it. Reproduced on scatter at 1194x518 (ratio 2.31) - the last symbol row is completely covered. At 984x858 (ratio 1.15) width binds instead and there is no overlap, which is why this is easy to miss on a normal desktop window. Add an optionalsafeAreaBottomMaptocreateLayout. The reserved strip is subtracted before the scale is derived, and the game area centres in what is left rather than in the whole canvas. It defaults to 0, so a layout that does not set it produces identical numbers to before. scatter opts in here as a worked example. The other five samples have the same latent overlap and can adopt it with their own values. Co-Authored-By: Claude Opus 5 noreply@anthropic.com