screen cropped on moto g(8) power

Hello, pretty new to Solar2D :slight_smile:

I’m building a simple game with my kids, and we noticed that the Solar2D cannot paint over the entire screen… for some reason it crops near the the front camera, and the game looks a bit weird.

As a background we’re simply painting a large gray rectangle, centered in the middle of the screen, with dx and dy double the size of the screen… but we still see black corners…

I think we’re doing something wrong…

thanks again for the help!

Alex

Hi Alex!

I tried this on simulator since I don’t have a test device with me right now. Can you test it out to see if it works?

I only have this one line of code with neither config.lua nor build.settings and it works for me on simulator.
local bg = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight )

Thanks for the reply. Let me try that out and I’ll send you a pic of what I see on our motorola phone.

ok, @bgmadclown, I run that basic test and I see the same things on my motorola phone. I chose the “landscape” mode for the app.

You can see that the left corner is translated to leave space for the front camera on the phone.

I added some markers to the pics I took of the corona sdk splash screen.

I think this has something to do specifcally with this type of phones… likely something needs to change in corona or I should add some settings…

Thanks in advance for the help.

Hello Kumasoft,

Give this a try.

local width = display.actualContentWidth
local height = display.actualContentHeight
local centerX = display.screenOriginX + display.actualContentWidth * 0.5
local centerY = display.screenOriginY + display.actualContentHeight * 0.5
-- assume default anchors of 0.5, 0.5
local bg = display.newRect( centerX, centerY, width, height )

If it works, you can check this page, https://docs.coronalabs.com/api/library/display/index.html
for details of some of these display properties.

I probably rushed for the solution. I’m sorry about that. Can you share your config.lua file so that we can test and see exactly the same thing?

Hey!

A bit late response, but I just finished rewriting my screen module that is intended to handle things like this. Please check out this post and let me know if it helps you out:

Hey folks (@XeduR and @bgmadclown) thanks super for all the help. A bit late in replying, but I fixed the problem with @XeduR Screen utility which I reused a bit.

The key for me was to use

native.setProperty("androidSystemUiVisibility", "immersiveSticky")

and also wait a bit at the beginning to make sure the setting sticks…

Our game is now live in the Android store :slight_smile:

1 Like