Happy New Year,
I am developing my application by following This tutorial (using LibGdx, extents Game, with AbstractScreen, using Stage). However, currently I am experiencing a very funny issue. Everything display correct on my Samsung phone but not on my ASUS Nexus 7. Please see this link for the recorded video (MP4: ~800kb) of both devices. As you can see from the Samsung phone, you can see the “Fullmoon Inc.” splash screen (~25 secs). However, my nexus 7 display nothing at all even though I am sure that my application is running on my nexus 7 (sound played on certain timeframe). I tried to update my nexus 7, reset back to factory default, run on empty profile, still no luck at all. I am absolutely no idea what to do to fix it.
Another thing is that the loading bar on the loading screen (from 5secs – 23secs) is not display correctly. According to the following code, the loading bar (the yellow windows) should load in a smooth manner. However, as per what you can see on the video, it is not. Currently the bar only display "After" everything is loaded. Can anyone please lead me back to the correct path?
loadingPercent = Interpolation.linear.apply(loadingPercent, thisApps.assetManager.getProgress(), 0.1f);
this.loadingYellowBox.setWidth(-1040 + (int) (loadingPercent * 1040));
Thank you very much, and all comments are welcome.
I can answer the second part of question. AssetManager calculates percent based om number of asssets not on their size. Suppose you have huge texture atlas which is packed in one texture and several other small resources. Loading of the atlas takes 9 seconds and there are 4 other small resource which take 1 second to load.
So, see what happens. You have 20%-20%-20%-20%-20% when you expect 90%-10&.
If you want to more precise percentage you need to calculate percentage some other way.
Blank screen glitch is trickier. You need to check that Stage is properly initialized, aspect ratio is correct, resources are loaded correctly. You can download source code for libgdx, add it to your project and go through render method with debugger. If you find something suspicious there you can update this post or create a new one.
i finally figured out where the problem came from. the issue is that when i pack all my images, i set the Max page width and Max page height to 4086. i am guessing that somehow Nexus did not "really" load those images. problem solved when i reduced both Max page width and Max page height to 2048. anyway, i still appreciated helps from both #noone and #son-of-the-northern-darkness
Related
I have a old application running a Swing client. I upgraded from Java 7 to 8 a long time ago. The upgrade went fine. Ever since I have wanted to upgrade to Java 9, then 11 and now 13. However this is where I meet problems.
The UI looks fine and as intended with Java 8, but any newer Java version will somehow change the font sizes and maybe components for some reason. I do not have any pictures to show because the application is maintained on a network without internet access because of security reasons. The client looks like most thing is multiplied with a factor of 2.0 or something. It appears as zoomed or maybe something you would create with universal design in mind. Even the splash screen is doubled in size for some reason and that is an image. There are some exeptions. The title text in the windows is the same. Also text on buttons and lables seems to be equal. Icons, images (splash) and text inside textfields/editors is much larger.
I have tried to find a solution for a long time but have not found anything. I am hoping someone else have experienced this problem or at least know what the problem could be.
Holgers comment about OS scaling was the issue. I have a 4K screen with 150% scaling set in the OS. Putting it back to 100% made the Java Swing Client look the same as when running Java 8.
To override add -Dsun.java2d.uiScale=1
Se also https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display
Why my text inside the android design viewer appears blurry. I tried changing the resolution DPI setting as well. But it didn't work for me.
Please look at my second picture, to let you know which one is I am talking about.
Try changing the scaling to 100% instead to 125%. Normally in Windows 10 default scale in 125% recommended. But using 100% will fix this.
To Find Scaling Setting:
Right Click on the desktop
Navigate to Display Setting
Dont Forget to go advanced scaling setting
And
Turn on the Fixed Scaling for the apps
Just incase sometimes
Before:
After:
How about changing device settings?
It just change the resolution of example device and it would make more clear sight from design view. It doesn't change the layout codes.
It would help the development with clear visual, but you have to test various resolutions of devices if you needed to.
Go to 'Help' tab and click on 'Edit Custom Properties'. It might ask you to generate a file if it doesn't already exist. Once this properties file was made, I wrote 'hidpi=false' (no quotations) on a new line, saved it, and restarted Android Studio.
I have a Java/JavaFX application deployed as a native install for Windows and Mac. The bundled runtime is currently 8.121. You can find the installers and the Java code here: George download
I have been using this application in the classroom weekly (with 20 children) for the last 15 months, and right from the start I have seen the following problem:
From time to time, buttons disappear. That is to say, they are simply rendered as a white rectangle, making them effectively almost invisible. Both the background and label/text disappear.
This mainly happens on mouse-over, but then does not correct itself.
The buttons are still there, and clickable.
It only happens sporadically, but it seems to recur on certain machines more than others. Windows 10 now, but used to the same happened on tiny Windows 7 machines previously.
I am not able to reproduce it myself and have never seen it on a Mac, I think.
It now also happens sometimes with other widgets/controls, and even before any user interaction.
Is there some known issue around this?
Has anyone else described something similar?
Might it have something to do with certain minor operating system adjustments?
Any thoughts or ideas would be much appreciated.
Update (2018-11-06)
Just started testing my application in Java 8 in VirtualBox with Windows 10, and I now get the rendering error myself. Hurra!
Looking into the -Dprism.xxx options, I found this article:
http://werner.yellowcouch.org/log/javafx-8-command-line-options/
Testing with -Dprism.threadcheck=true, I get a lot of
"ERROR: PrismPen / FX threads co-running: DIRTY: false" with stack traces.
Setting -Dprism.dirtopts=falsedoes not solve it for me, though.
But running with -Dprism.order=sw does. But this is not a good solution for an application that may do some demanding rendering (Turtle Geometry).
Will keep digging.
I've been having the same issue, I tried updating to Java 10 but the issue remained. I then edited the properties on java.exe and on the 'Compatibility' tab I set 'Override high DPI scaling behavior' to 'System (enhanced)' and the problem seems to have gone away (or at least it hasn't happened again yet).
I observed the same thing: Visually disappearing (but still functional) buttons and other controls (except labels) especially in areas outside the original size of the window after I have resized it manually)
In my case -Dprism.dirtopts=false reduced the problem but also didn't solve it (and was not really a satisfying solution anyway).
Additionally I observed that some TextField controls also showed rendering glitches (looked like the same text was rendered twice with a little offset). That finally put me on the right track:
It turned out to be just a missing Platform.runLater(...) around some calls to TextField.setText(...) (from another thread) for exactly these TextField controls, which was causing this (even for e.g. a Button which is at a totally different place - also in the widget hierarchy).
I know, this is probably not the answer in all cases, but hopefully it helps at least some others facing the same problem (took me a full day to find out).
I'm working on an android project in LibGDX which I mainly test using the DesktopLauncher. I have some UI, set using Scene2d elements. They look great on Desktop, but really off using an emulated nexus 7. How can I make them scale correctly and have the same position as on Desktop?
Thing is, I've set a button , for example, to have position x=300, y=200. While this looks good on Desktop, it differs on mobile. How can I scale them in such a way that the positions are the same, no matter the resolution?
I've found online about viewports, but they didn't help.
I have managed to find an answer. For all those who might have this issue in the future, I solved the problem using this guide
https://github.com/libgdx/libgdx/wiki/Viewports
On top of that, what fixed my issue was setting
viewport.apply(true);
The parameter centers the camera, that solved my issue.
I have an Windows Phone 8 app made with PhoneGap framework to show a map of OpenLayers. Sometimes, although very rarely, I surf between views (jQuery Mobile is used) and suddenly when I am back on Map it shows an extra tile on the center of map. Tile is as wide as the map and starts some 20% before top and ends some 20% from bottom. It does disappear only when restarting the app.
I am trying to show up the phenomenon on dev mode of Google on browser, but so far no success.
No error is shown on console of wp8 sdk, I was testing it on device connected to visual studio.
What may cause that thing and could it be fixed somehow?
edit1: It may be possible I trigger a swipe event while moving the screen fast and that may make the Openlayers in error state.
First try:
I added this line:
-ms-scroll-chaining: chained;
to the div containing the map.
I used jQuery / HTML5 / gwt app for WP8 (Lumia 920) device: vertical css scroll fix to attach another things to same place, so I added it there.
UPDATE
This was not the fix, problem stayed. See below the correct answer:
The real answer:
https://github.com/openlayers/openlayers/issues/929 tells this is known issue of openlayers, that is already fixed in the latest version.
So, please update version of OpenLayers!