The game works on Windows with fullHD. with a 2 Monitor setup on Linux I am running in the following problem:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't set display mode 3200x1080, fullscreen: true
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:150)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:131)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Details about the 2 displays: First FullHD, second 1280x1024
I get the width an hight with the following lines (cfg is the configuration variable)
cfg.width = Toolkit.getDefaultToolkit().getScreenSize().width;
cfg.height = Toolkit.getDefaultToolkit().getScreenSize().height;
Any help appriciated. If you need more info, please let me know :D
Is there a way to get the width, height only for the primary display?
Yours,
Florian
Related
I am just a beginner :) Can any one help me out??
When I click the plus sign to create a new cell in a workbook I get an error. The new cell isn't created and I see this error message in a larger than usual font.
The error message survives a restart of the kernel.
The error is gone after I restart VSCode.
The error is also gone after I save / close the file and re-open it.
code
System.out.print("hello jshell");
and then i hit alt + enter
output
hello jshell
TypeError: Cannot read property 'charAt' of undefined at
in t
in div
in t
in div
in t
in div
in t
in div
in div
in div
in div
in div
in div
in t
in h
in t
in div
in div
in div
in t
in main
in div
in t
in h
in f
I am using
VS-code version : 1.51.1
jupyter core : 4.6.3
jupyter-notebook : 6.1.5
qtconsole : 4.7.7
ipython : 7.18.1
ipykernel : 5.3.4
jupyter client : 6.1.7
jshell : 15.0.1
out put screen shot
I've added the java to Jupyter Kernel and with many tests conducted, it's an issue in VS Code:
There're many similar issues posted in GitHub and now, this function is solved in VS Code Insiders but still not in VS Code:
You can install VS Code Insider, but it may not that stable, after all it's the beta-version of VS Code. In another way, you can turn to JupyterLab, try it in browser or install it.
I'm building a game in LibGDX and have began adding visual aspects of the game such as the logo. Considering that I've been using the default libgdxXXX.png files as placeholders for my logo, and that I'm replacing them with my logo, I didn't feel it had any more purpose in my program. I decide to delete it; but it decide to not compile and come up with this error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: assets/libgdx128.png
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:148)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:196)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:142)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: assets/libgdx128.png (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:145)
... 3 more
Somehow, when I return the files from the Trash (I use Linux), it works again! I have checked my code and found nothing I wrote referred to those files. When I deleted the files 1 by 1, the error changes from libgdx128.png to libgdx64.png to libgdx32.png to libgdx16.png respectively. I have changed all the references from libgdx128.png to my logo.png in my code; yet when I try to delete the libgdx logo and run my program, it fails to compile! Any ideas?
I found out my problem. I forgot all about this code at DesktopLauncher.java:
for (int size : new int[] { 128, 64, 32, 16 }) {
configuration.addIcon("assets/libgdx" + size + ".png", FileType.Internal);
}
I did not know it was referencing to the files I have deleted. The configuration.addIcon(); was the code setting the program icon - similar to how a favicon works. I will be adding my own icon now that I know what the code does.
Hope this helps anyone else confused about the error.
I'm trying to make basic game in Eclipse libGDX. I have Problem with rendering sprite. I do everything like it shoud be, but I still get this Error:
LwjglGraphics: created OpenGL 3.2+ core profile (GLES 3.0) context.
This is experimental! Exception in thread "LWJGL Application"
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: BG.png
at com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:148) at
com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
at com.badlogic.gdx.graphics.Texture.(Texture.java:100) at
com.badlogic.gdx.graphics.Texture.(Texture.java:92) at
com.zebrabandit.egghead.Assets.Load(Assets.java:13) at
com.zebrabandit.egghead.GameScreen.(GameScreen.java:24) at
com.zebrabandit.egghead.EggHead.create(EggHead.java:10) at
com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:147)
at
com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found:
BG.png (Internal) at
com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136) at
com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222) at
com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:145) ... 8 more
And here is my CODE:
public static Texture backgroundT;
public static Sprite backgroundS;
...
backgroundT = new Texture(Gdx.files.internal("BG.png"));
backgroundT.setFilter(TextureFilter.Linear, TextureFilter.Linear);
backgroundS = new Sprite(backgroundT);
backgroundS.flip(false, true);
...
#Override
public void render(float delta) {
Gdx.gl.glClearColor(1F, 1F, 1F, 1F);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
//rendering code :D
batch.draw(Assets.backgroundS, 0, 0);
batch.end();
}
I assume you have initialized your project with the setup application Tool
(gdx-setup.jar).
Then it's possible you are experiencing the working directory setup problem.
That's what the error says(Couldn't load file)
In IDEA IDE I have to edit configuration so the working directory points to folder in project: android\assets
File not found question was answered here
For further reference please check the video Mario Zechner has recorder to ease work the Eclipse users:
Running and Debugging in Eclipse
Couldn't load file: BG.png at com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:148) at ...
I think your problem is you are trying to load a file, that is not there. Are you absolutely sure that there is a file in that location Gdx.files.internal("BG.png").
Also you will have many problems if you are trying to load assets with uppercase characters in their names on android. So if your file is there, try renaming it to all lowercase characters.
I clearly stored my "background.png" in the assets folder under android.
I also checked that it was there in Finder.
I am working with Android Studio.
However, upon trying to access the image:
public Background() {
textureRegion = new TextureRegion(new Texture("background.png"));
textureRegionBounds1 = new Rectangle(0 - Constants.APP_WIDTH / 2, 0, Constants.APP_WIDTH, Constants.APP_HEIGHT);
textureRegionBounds2 = new Rectangle(Constants.APP_WIDTH / 2, 0, Constants.APP_WIDTH, Constants.APP_HEIGHT);
}
I get this error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: background.png
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
at com.badlogic.gdx.graphics.GLTexture.createTextureData(GLTexture.java:185)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:103)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:95)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:91)
at com.com.waylonhuang.game.actors.Background.<init>(Background.java:21)
at com.com.waylonhuang.game.stages.GameStage.setUpBackground(GameStage.java:66)
at com.com.waylonhuang.game.stages.GameStage.setUpWorld(GameStage.java:59)
at com.com.waylonhuang.game.stages.GameStage.<init>(GameStage.java:51)
at com.mygdx.game.GameScreen.<init>(GameScreen.java:16)
at com.mygdx.game.DrifterGame.create(DrifterGame.java:11)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:137)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: background.png (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
... 13 more......
What am I missing?
EDIT
Also, my current path for the Desktop launcher for the Working Directory is : AndroidStudioProjects/libGDXGame
However, upon changing it to: AndroidStudioProjects/libGDXGame/android/assets
I get a new error like such:
Exception in thread "LWJGL Application" java.lang.NullPointerException
at com.com.waylonhuang.game.stages.GameStage.draw(GameStage.java:134)
at com.mygdx.game.GameScreen.render(GameScreen.java:25)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:208)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
try using this:
textureRegion = new TextureRegion(new Texture(
Gdx.files.internal("background.png")));
if it does not work review, case sensitive, of the file name.
Edit: look that is a copy of the file, not a link, once he happened to someone so wrong
You shouldn't load assets in a constructor directly because Gdx.files is null. Either load the assets outside of the constructor or use the AssetsManager.
I'm trying to run the orientationJ from macro following the directions by the developers http://bigwww.epfl.ch/demo/orientation/
// Call the Measure plugin from a ImageJ macro
makeRectangle(250, 250, 50, 50);
run("OrientationJ Measure", "sigma=.0.0");
// sigma: standard deviation of the Laplacian of Gaussian prefilter
// The results are displayed on the log window of ImageJ in tab-separated format
However, I'm getting the error below. How do I fix this?
ImageJ 1.48v; Java 1.6.0_20 [64-bit]; Windows 7 6.1; 6666K of 3068MB (<1%)
java.lang.NumberFormatException: multiple points
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1084)
at java.lang.Double.parseDouble(Double.java:510)
at OrientationJ_Measure.run(OrientationJ_Measure.java:62)
at ij.IJ.runUserPlugIn(IJ.java:199)
at ij.IJ.runUserPlugIn(IJ.java:210)
at ij.IJ.runPlugIn(IJ.java:163)
at ij.Executer.runCommand(Executer.java:131)
at ij.Executer.run(Executer.java:64)
at ij.IJ.run(IJ.java:269)
at ij.macro.Functions.doRun(Functions.java:590)
at ij.macro.Functions.doFunction(Functions.java:89)
at ij.macro.Interpreter.doStatement(Interpreter.java:226)
at ij.macro.Interpreter.doStatements(Interpreter.java:214)
at ij.macro.Interpreter.run(Interpreter.java:111)
at ij.macro.Interpreter.run(Interpreter.java:81)
at ij.macro.Interpreter.run(Interpreter.java:92)
at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153)
at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:137)
at ij.plugin.Macro_Runner.run(Macro_Runner.java:34)
at ij.IJ.runPlugIn(IJ.java:169)
at ij.Executer.runCommand(Executer.java:131)
at ij.Executer.run(Executer.java:64)
at java.lang.Thread.run(Thread.java:619)
run("OrientationJ Measure", "sigma=.0.0");
Your sigma value has two decimal points. Remove the first one.
java.lang.NumberFormatException: multiple points
It is complaining about that. Probably a typo in the example.