I need to use immersive mode in my project, so I put this in my AdroidLauncher.java:
config.useImmersiveMode = true;
But I still have a black bar on top of the screen (as on screenshots below). How can I make the app draw there too?
screenshot1, navigation turned off
screenshot2, navigation turned on
I run the app on API 30 (Android 11), libGDX version is 1.11.0.
Related
I am trying to create a canvas in html that the user can draw on. It works fine with any mouse-device like a pc or max. It also works fine with a non-ios touch devices (like an android/windows tablet). But with ios-touch devices (like an ipad or iphone) it doesn't work. When you try to draw, it scrolls the page while you draw. Any idea how to disable this scrolling action on ios devices while drawing on the canvas?
Here is an example of a html drawing canvas http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/ Try and draw on one of the canvases on an ipad or iphone, BUT NOT THE FIRST DEMO, for some reason the first demo works but none of the others work.
I got it working by using onTouchStart, onTouchMove, onTouchEnd.
For onTouchMove, you'll get an array of changedTouches. For pen usage, the first one will do since there won't be multiple touch events at a time.
const position = { x: event.changedTouches[0].pageX, y: event.changedTouches[0].pageY };
If I am limited to say a 1920 x 1080 screen, how do I create media queries for a larger screen size without being able to test it?
You can set any resolution in Chrome. Just click "Toggle device mode" in Inspector and set any resolution.
In Chrome Developer Tools, you can use Device Mode to emulate any resolution, not just mobile breakpoints.
If you are using Google Chrome, you can open the web inspector Ctrl-Shift-I, then toggle Device Mode using Ctrl-Shift-M. It's mainly used for smaller devices, but you should be able to select 'Responsive' in the menu that comes up at the top of the screen, and enter any resolution you wish, along with a zoom level so that you can view it on your screen, albeit scaled.
If you are using Safari, you can do this relatively easily.
If you aren't using Safari, you probably should get it, at least for website testing. As you can see on step 6, Safari has LOTS of VERY helpful dev tools (i.e. disable JS, disable CSS, etc.).
Here is some instructions with pictures!
Go to the Safari menu (in upper left hand corner).
On that menu click Preferences, this should open up a pop-up box.
On the pop-up box, click the Advanced tab.
At the very bottom of that tab you should see a checkbox that says Show Develop menu in menu bar, check that box.
Now load your website in Safari.
When your website has loaded (for this example I'm using SO), click on the Develop dropdown menu.
Click Enter Responsive Design Mode, and that will now show your website in a window smaller than your browser window.
In that window, click on the window looking thing on the far left.
There are little gray bars on all sides of that smaller window, if you drag these you can make the size whatever you want.
As a side note, when you drag the gray bars (as shown in step 9), you should see the width and height resolution (pixels) change (see screenshot below), this is VERY helpful (and I use it all the time), as it will tell you the exact resolution (pixels) when your website breaks. P.S. you can go to ANY screen resolution - big and small - that you want to with this tool, which is really cool! (I've done 2500 x 1500, 100 x 100, etc.)
Hope this helps you!
The screen resolution of the nexus 5 is 1920X1080, and Libgdx says it is 1794X1080. I'm using it in landscape mode, and libgdx is getting the height correct, but it reduces the width. I guess that is because is not counting the pixels of the navigation bar.
Is there any solution to make libgdx to detect the width including the navigation bar?
If you just want to get real display resolution you should check this question. But I think you may want to run your application in real fullscreen mode. That's it, without navigation bar. Just set useImmersiveMode to true in your AndroidApplicationConfiguration.
You can Read about Android immersive mode here: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/backends/android/AndroidApplicationConfiguration.html#useImmersiveMode
I´m writing a webapp for an iPad with HTML5, JavaScript and jQuery. My users need to take pictures with the build-in camera. For that reason I am using input type="file". This works great in different browsers (Chrome/Safari Mobile) but the problem is that when I add my app to the homescreen and take a photo in lanscape fullscreen mode- iOS brings up the camera from the wrong side. To be clearer iPad in landscape mode camera slides in from the left side(should be from the bottom). It behaves like it was called from portrait mode and the picture has a dark part on the left side. The camera window automatically changes the orientation - I debugged it - twice (0°/-90°). When I finish taking the picture and return to the app it is displayed in portrait mode, even though holding it on landscape mode. And additionally the screen is somehow locked. Thsi behaviour doesen't occure holding the iPad in portrait mode. Anyone an idea how to solve this strange behaviour? I found that question but no answers...
I am building a mobile app for iPad using HTML, Javascript, CSS, and jQuery Mobile. I have popups with the black close (x) icons in the upper right hand corner of the popups. Everything works fine on desktop iPad simulator using safari browser. I click a button/link, and a popup fires, displaying the icon in the upper right hand corner. When I publish to my website, and view on my iPad, Safari browser, (1st generation), the close (x) icon disappears, the container for the icon is there, just no icon. I have checked, and all the files uploaded to my server correctly... anyone have any ideas here? thanks for any help!
Problem is with your server
Icon file gives Internal Server Error