slick2d

xml FileNotFoundException using slick2D library in java

限于喜欢 提交于 2019-11-28 09:56:09
问题 private ConfigurableEmitter emitter; File xmlFile = new File("ressources/emitter.xml"); emitter = ParticleIO.loadEmitter(xmlFile); If I launch the project in eclipse, everything will works fine, but after I export my project and use JarSplice to create a .jar file, when I launch the jar file using the command prompt, the program will crash launching a FileNotFoundException, saying it cannot find the path specified. java.io.FileNotFoundException: ressources\emitter.xml (The system cannot find

No OpenGL context found in the current thread, how do I fix this error?

喜你入骨 提交于 2019-11-27 16:03:35
I'm working on a card game, and currently have a good foundation but I'm running into an error when I run it in eclipse. I'm also using slick 2d. Here is the error from the console. Exception in thread "main" java.lang.RuntimeException: No OpenGL context found in the current thread. at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glGetError(GL11.java:1277) at org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.glGetError(ImmediateModeOGLRenderer.java:387) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java

Slick2D and JBox2D. How to draw

与世无争的帅哥 提交于 2019-11-27 11:30:29
Before asking this i did A LOT of searching on the net. I just can't do it. It's a little hard for me to understand. So how do i draw the images at the right screen positions coresponding to bodies in world position? Thanx. If anyone else finds himslef in front of the same obstacle i posted a HOW TO, thanx to normalocity's good explanation. You can find it here: http://romeo.akademx.ro/2012/04/06/slick-and-box2d/ This is the render function: public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException { g.setBackground(Color.white); g.pushTransform(); g