Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Android, there is always a black bar on top — Gideros Forum

Android, there is always a black bar on top

E1e5enE1e5en Member
edited November 2022 in General questions
When exporting to Android, there is always a black bar on top. I fill the background using the application:setBackgroundColor() function and thought that the entire area of the screen would be filled in, but no. I set the Scale Mode parameter in Lettebox and Fit Height. As if the strip remains from the player menu.



Beginner game developer:https://e1e5en.itch.io, Google Play

Comments

  • I am not sure but what you were searching is this one maybe:
    http://giderosmobile.com/DevCenter/index.php/Showing_Status_Bar
  • To build Windows Desktop, a small white stripe appears at the bottom. There is nothing for Win32.

    Beginner game developer:https://e1e5en.itch.io, Google Play
  • The initial parameter in the file looks a little different (than described). But in any case, it doesn't help.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • hgy29hgy29 Maintainer
    E1e5en said:

    To build Windows Desktop, a small white stripe appears at the bottom. There is nothing for Win32.

    I noticed that too, I suspect a canvas size rounding issue in the player (due to the zoom factor it supports in the menu perhaps), but I never saw it anywhere else. On Android, did you have a look at "require" plugin and the settings to accomodate tall screens ? It may be because android itself restricts the app area because it thinks the app doesn't handle the screen aspect ratio. But then you would also have a black bar at the bottom of the screen.
  • hgy29 said:

    E1e5en said:

    To build Windows Desktop, a small white stripe appears at the bottom. There is nothing for Win32.

    I noticed that too, I suspect a canvas size rounding issue in the player (due to the zoom factor it supports in the menu perhaps), but I never saw it anywhere else. On Android, did you have a look at "require" plugin and the settings to accomodate tall screens ? It may be because android itself restricts the app area because it thinks the app doesn't handle the screen aspect ratio. But then you would also have a black bar at the bottom of the screen.
    This is a build, not a launch through the player (although I mean technically it's the same thing).

    About Android, I'll try to search, thank you.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • I tried these settings, it doesn't help.

    Beginner game developer:https://e1e5en.itch.io, Google Play
  • MoKaLuxMoKaLux Member
    edited November 2022
    did you solve your android issue?
    https://wiki.gideros.rocks/index.php/Application:getLogicalBounds

    You usually wants to make the background bigger than the screen so you wouldn't see those black bars then you could place your sprites anywhere using myappleft, myapptop, myappright, myappbot.

    For example the background could be a pixel with its anchor point at 0.5, 0.5, with a scale/size which will cover the whole screen placed in the center of your app.

    Another solution would be to use stretch mode instead of letter box in the app screen params.

    Hope this helps?!
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • E1e5enE1e5en Member
    edited November 2022
    MoKaLux said:

    did you solve your android issue?
    https://wiki.gideros.rocks/index.php/Application:getLogicalBounds

    You usually wants to make the background bigger than the screen so you wouldn't see those black bars then you could place your sprites anywhere using myappleft, myapptop, myappright, myappbot.

    For example the background could be a pixel with its anchor point at 0.5, 0.5, with a scale/size which will cover the whole screen placed in the center of your app.

    Another solution would be to use stretch mode instead of letter box in the app screen params.

    Hope this helps?!

    No, I haven't solved the problem. I was hoping that they would tell me, but nothing helps.
    It's not just the background (sprite), but the rendering area itself. This problem is visible if the background is painted over with a different (not black) color (using the application:setBackgroundColor() function).
    In my screenshot, the background color is set this way.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • hgy29hgy29 Maintainer
    OpenGL Canvas (filled by setBackgtoundColor) should take full app screen. If it doesn’t they probably your phone doesn’t recognize the app as one that should take full screen. Could this shed some light ? https://www.samsung.com/us/support/troubleshooting/TSG01001466/

    Likes: MoKaLux, E1e5en

    +1 -1 (+2 / -0 )Share on Facebook
  • stretch mode?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29 said:

    OpenGL Canvas (filled by setBackgtoundColor) should take full app screen. If it doesn’t they probably your phone doesn’t recognize the app as one that should take full screen. Could this shed some light ? https://www.samsung.com/us/support/troubleshooting/TSG01001466/

    My smartphone is Poco X3 Pro. In the settings for the app, I have enabled the setting: Fullscreen mode. It didn't help.
    To check:
    1. This version is made on the Godot Engine game engine (I did not set any settings or permissions): https://play.google.com/store/apps/details?id=org.e1e5en.dashingball&pli=1
    2. This version is made in the Gideros game engine: https://e1e5en.itch.io/dashing-ball?password=gideros

    I have not encountered such a problem in other engines.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • hgy29hgy29 Maintainer
    Accepted Answer
    I never encountered such problem with Gideros, maybe this https://forum.xda-developers.com/t/apps-not-getting-fullscreen.4319643/? But if that’s so I’d like to know how we are supposed to tell android we can go full screen.

    Likes: E1e5en

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29 said:

    I never encountered such problem with Gideros, maybe this https://forum.xda-developers.com/t/apps-not-getting-fullscreen.4319643/? But if that’s so I’d like to know how we are supposed to tell android we can go full screen.

    Yes, it really helped.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • MoKaLuxMoKaLux Member
    edited November 2022
    ok I tested your game on my phones:
    - samsung s5 full screen OK, no black bars (nor left/right, nor top/bottom)
    - samsung J6 full screen OK, no black bars (nor left/right, nor top/bottom)
    - xiaomi redmi7 full screen NOT OK, the phone has a notch and the game doesn't cover it (I checked enable full screen in the app settings + in the gideros Require plugin). Otherwise it seems to cover the rest of the screen with no black bars

    I had a look at your code and it is confusing me :p
    	-- Get size screen, content area
    	self.W_DEVICE = application:getDeviceWidth()
    	self.H_DEVICE = application:getDeviceHeight()
     
    	self.W = application:getContentWidth()
    	self.H = application:getContentHeight()
     
    	-- Center
    	self.W_CENTER = application:getContentWidth() / 2
    	self.H_CENTER = application:getContentHeight() / 2
     
    	-- Absolute values
    	local _dx = application:getLogicalTranslateX() / application:getLogicalScaleX()
    	local _dy = application:getLogicalTranslateY() / application:getLogicalScaleY()
     
    	self.DEVICE_LEFT = -_dx
    	self.DEVICE_RIGHT = _dx + application:getContentWidth()
    	self.DEVICE_TOP = -_dy
    	self.DEVICE_BOTTOM = _dy + application:getContentHeight()
     
    	self.DEVICE_W = _dx * 2 + application:getContentWidth()
    	self.DEVICE_H = _dy * 2 + application:getContentHeight()
     
    	-- Position (range)
    	self.RANGE_TOP = 	-application:getContentHeight() / 2 + 137
    	self.RANGE_BOTTOM =  application:getContentHeight() / 2 - 137
    	self.RANGE_LEFT = 	-application:getContentWidth() / 2 + 120
    	self.RANGE_RIGHT =	 application:getContentWidth() / 2 - 120
    I personally only use this https://wiki.gideros.rocks/index.php/Application:getLogicalBounds but I haven't tested my app on my phone with a notch yet!

    PS: nice game :)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29 said:
    I believe that this setting can be added to the Android project template. And allow the developer to choose the display mode via the Require plugin.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • MoKaLux said:

    ok I tested your game on my phones:
    - samsung s5 full screen OK, no black bars (nor left/right, nor top/bottom)
    - samsung J6 full screen OK, no black bars (nor left/right, nor top/bottom)
    - xiaomi redmi7 full screen NOT OK, the phone has a notch and the game doesn't cover it (I checked enable full screen in the app settings + in the gideros Require plugin). Otherwise it seems to cover the rest of the screen with no black bars

    Your test shows that there really is a problem and requires configuration (as indicated above).
    MoKaLux said:


    I had a look at your code and it is confusing me :p

    	-- Get size screen, content area
    	self.W_DEVICE = application:getDeviceWidth()
    	self.H_DEVICE = application:getDeviceHeight()
     
    	self.W = application:getContentWidth()
    	self.H = application:getContentHeight()
     
    	-- Center
    	self.W_CENTER = application:getContentWidth() / 2
    	self.H_CENTER = application:getContentHeight() / 2
     
    	-- Absolute values
    	local _dx = application:getLogicalTranslateX() / application:getLogicalScaleX()
    	local _dy = application:getLogicalTranslateY() / application:getLogicalScaleY()
     
    	self.DEVICE_LEFT = -_dx
    	self.DEVICE_RIGHT = _dx + application:getContentWidth()
    	self.DEVICE_TOP = -_dy
    	self.DEVICE_BOTTOM = _dy + application:getContentHeight()
     
    	self.DEVICE_W = _dx * 2 + application:getContentWidth()
    	self.DEVICE_H = _dy * 2 + application:getContentHeight()
     
    	-- Position (range)
    	self.RANGE_TOP = 	-application:getContentHeight() / 2 + 137
    	self.RANGE_BOTTOM =  application:getContentHeight() / 2 - 137
    	self.RANGE_LEFT = 	-application:getContentWidth() / 2 + 120
    	self.RANGE_RIGHT =	 application:getContentWidth() / 2 - 120
    I personally only use this https://wiki.gideros.rocks/index.php/Application:getLogicalBounds but I haven't tested my app on my phone with a notch yet!
    I was just dealing with the engine and decided to use such methods by analogy with another one. I still have to deal with Gideros.
    MoKaLux said:


    PS: nice game :)

    Thanks. =)

    Likes: MoKaLux

    Beginner game developer:https://e1e5en.itch.io, Google Play
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Indeed, I didn’t know some android phones had notches now, the notch management code is only present in Gideros for iOS

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • I wanted to clarify: the ability to configure exports for Android, which was discussed here, will be implemented in the future? I'm not rushing, I'm just interested. Maybe I could try to implement it myself.
    Beginner game developer:https://e1e5en.itch.io, Google Play
  • I didn't look at the commits in github. I saw that you have already done everything. Thanks! =)

    Likes: MoKaLux, hgy29

    Beginner game developer:https://e1e5en.itch.io, Google Play
    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.