Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2019 5:07 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Dx bad class
PostPosted: Tue Jan 03, 2012 6:44 pm 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
Hi,

I want to try the slick ae library and the test project. But when I want to build the apk the compiler said: "Dx bad class file magic (cafebabe) or version (0033.0000)" for every class in the slick ae library.
I read in some other forums that I should update proguard. I did it but the mistake is still there. I tried various api-versions (1.6, 2.1, 2.2, 2.3.3) but the error won't go away ...

I'm at the end of my rope.
Do you have any idea? Thanks!


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Wed Jan 04, 2012 12:53 pm 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
Ok I downloaded the latest version of the slickae.jar from Mr. Kenkron (thanks) and now it works.

But I have another question.
I want to make an empty image ingame and get the graphics and draw some stuff on this image. But everytime I use getGraphics() I get the following error:
01-04 12:44:20.740: E/AndroidRuntime(331): FATAL EXCEPTION: GLThread 10
01-04 12:44:20.740: E/AndroidRuntime(331): java.lang.NoClassDefFoundError: org.lwjgl.opengl.GLContext
01-04 12:44:20.740: E/AndroidRuntime(331): at org.newdawn.slick.opengl.pbuffer.GraphicsFactory.init(GraphicsFactory.java:40)
01-04 12:44:20.740: E/AndroidRuntime(331): at org.newdawn.slick.opengl.pbuffer.GraphicsFactory.createGraphics(GraphicsFactory.java:120)
01-04 12:44:20.740: E/AndroidRuntime(331): at org.newdawn.slick.opengl.pbuffer.GraphicsFactory.getGraphicsForImage(GraphicsFactory.java:91)
01-04 12:44:20.740: E/AndroidRuntime(331): at org.newdawn.slick.Image.getGraphics(Image.java:444)
01-04 12:44:20.740: E/AndroidRuntime(331): at org.apogames.icejump.ApoIcejumpPanel.makeAndGetGoodie(ApoIcejumpPanel.java:278)


Code:
try {
   iGoodie = new Image(ApoIcejumpConstants.GOODIE_WIDTH, ApoIcejumpConstants.GOODIE_HEIGHT);
   Graphics g = iGoodie.getGraphics();
         
   g.setAntiAlias(true);
   Polygon p = new Polygon();
   p.addPoint(1, iGoodie.getHeight()/2);
   p.addPoint(iGoodie.getWidth()/2, 1);
   p.addPoint(iGoodie.getWidth() - 1, iGoodie.getHeight()/2);
   p.addPoint(iGoodie.getWidth()/2, iGoodie.getHeight() - 1);
   g.setColor(new Color(255, 255, 255, 120));
   g.fill(p);
   g.setColor(Color.black);
   g.draw(p);
} catch (SlickException e) {
   e.printStackTrace();
}


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Fri Jan 06, 2012 4:58 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
Glad I could help with the jar. Your latest problem is weird, because I can do almost the same thing, but I don't get an error message.

Code:
      endShot=new Image(container.getWidth(), container.getHeight());
      endShot.getGraphics();
      container.getGraphics().copyArea(endShot, 0, 0);


copyArea does not work on android, but I do not recieve exceptions when I call getGraphics().

Double check to make sure you have gdx-backend-lwjgl.jar and gdx-backend-lwjgl-natives.jar.
If you do, then perhaps goodie width and goodie height are too large (eg. larger than 1024, though I doubt this is the case)

let me know if this doesn't help.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Sun Jan 08, 2012 12:31 pm 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
Hi,

in my project I import gdx-backend-android.jar, gdx.jar and slick-ae.jar.
When I implement gdx-backend-lwjgl.jar and gdx-backend-lwjgl-natives.jar I get an error because it seems that two jars on my buildpath include the same package and classes. (Conversion to Dalvik format failed with error 1).

So the error is still present. =( So I make many images with photoshop and load them.

A new problem(?):
The fillRoundRect and the fill or drawOval methods don't work correct. When I use it some parts are empty!


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Tue Jan 10, 2012 4:03 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
The first error is beyond me. I can't really see the connection between conversion to dalvik and photoshop.

However, I have seen your second problem before. Calling draw and fill only really works right if you set the line width to something greater than one (such as 1.0625f) with graphics.setLineWidth(). I don't know why this is, and it is not a problem in slick desktop.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Fri Jan 13, 2012 5:23 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
My bad!

When I said before that getGraphics did not throw an exception, I was only testing it on the desktop environment. It did throw one on an actual android. I'll look into this.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Sun Jan 15, 2012 7:14 pm 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
Thanks for your help.

But your hint with setLineWidth() didn't work for me. When I call fillOval it nearly doesn't paint anything ... I don't know why but now I paint only images.

Until now I have make 3 games with SlickAE.


Top
 Profile  
 
 Post subject: Re: Dx bad class
PostPosted: Wed Feb 08, 2012 2:54 pm 
Offline

Joined: Wed Feb 08, 2012 2:42 pm
Posts: 7
New little question.

I have a problem with tablets and android 3.x. They have a system bar which I cant switch off. The gamescreen is moved up but the touch event aren't moved. And I don't know how to get the system bar height to convert the results. Is there a fix or a command I don't know?

Thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group