Added useSafeArea setting for mobile targets#20
Draft
nateboxer wants to merge 5 commits into
Draft
Conversation
…nstead of getDimensions()), safe_offset_x, safe_offset_y to state. WIP - this correctly sizes the viewport but does not center it corr ectly or use the safe offset values.
Author
Author
|
I was wondering if by replacing the two places where Shove gets "actual" dimensions, I was hobbling it such that it could not center the viewport. I tried keeping my initial change where state.screen_width and state.screen_height were getting overwritten but commenting out the other two places I replaced getDimensions() with getSafeArea(). It worked mostly. It still doesn't correctly handle the offset for the status bar, but it more or less centers the correctly sized viewport on the screen. |
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.

Added useSafeArea (optional, use window safe area for mobile target instead of getDimensions()), safe_offset_x, safe_offset_y to state. WIP - this correctly sizes the viewport but does not center it correctly or use the safe offset values.
I attempted to modify the existing offset_y property but that seems to be used for something different than I expected. I also attempted to apply the offsets to all the love.graphics.draw() commands, but that seemed to have no effect.
I could use some advice from the original author as to where I might apply a horizontal and vertical offsets.