Slick2D is better than Swing for a number of reasons, chief among them is its simplicity. It is very easy to jump in with just the documentation behind it. It also runs somewhat faster since it is layered over LWJGL, which uses OpenGL, to speed up the process. I would recommend using it for a beginning project, then moving on to other libraries or using straight-up LWJGL.

Busy between school, work, life, games, programming and general screwing around.If you'd like some pixel art for your game, send me a PM, i'll see what I can do.Current project: http://elementalwarblog.wordpress.com/

Slick2D is not modified Swing, it's a 2d graphics library that uses OpenGL for rendering. Java2D (an extension of Swing) has an OpenGL-accelerated path, but it's very finicky, drops to software rendering easily, and doesn't let you use any extra OpenGL features. Slick2D on the other hand strictly uses OpenGL, which makes it much much faster.

Where Slick is somewhat like Swing is in the API, specifically that the API is familiar to Java2D users. It's not an exact copy, but it's close enough that porting code is not extremely difficult.

For integrating with the native window system, Swing does much better (as good as Swing does anyway). Slick2D doesn't even have a concept of a button built in, you need third party widget sets like TWL or NiftyGUI to make those.

Personally, I tend to recommend LibGDX these days as a 2D library, but I won't hijack a Slick thread evangelizing it.

IMHO somebody should write a minimal Java2D-like wrapper on top of LibGDX, i.e. to replace Slick and feed the newbies a library that doesn't include words like "matrix", "blending" or what have you.

The only advantage to Slick is that it hides GL concepts (whereas LibGDX makes them visible), so if you are afraid to learn what actual graphic programming entails, and would rather be spoon fed, then you may prefer Slick.

Well, I am not that convinced to use Slick2D. I am not creating a high performance game anyway. However, my game looks laggy on my laptop for some odd reson(it is not really laggy as the fps is locked at 66. Its more like an graphical glitch), which is why I am considering switching to Slick2D.

I started converting my 2D game over from AWT over to Slick last night for several reasons.

The input handler on AWT was missing mouse eventsThe input handler on AWT was slow on keyboard eventI finally maxed out the Java2D canvas painter, and 90% of of my CPU time was sitting on the call to Graphics.drawImage() which I could not do anything to optimize.Using Slick2D I am able to not have to fake the shading and other effects to keep performance. I used to keep 4 versions of my tiles in different shades to quickly achieve the desired shading effect. With Slick2D, I am able to pull the shading off on the fly using the same logic.

However, Slick2D is over-simplified for my tastes. If you use BasicGame you don't have direct control over which GL "canvas" you are writing to it seems. The draw logic for an sprite/image seems to be in the Image() class and not in the rendering method. You call a whole bunch of methods to draw the images individually. This seems counter intuitive to me. There is probably some reason for it that is beyond my limited knowledge.

What I do know is I went from 20 fps in my game to 160fps. The memory footprint also went down because my images are now stored in VRAM, and the CPU went down a whole helluva lot (now it runs at 20% instead of 100%

However, Slick2D is over-simplified for my tastes. If you use BasicGame you don't have direct control over which GL "canvas" you are writing to it seems. The draw logic for an sprite/image seems to be in the Image() class and not in the rendering method. You call a whole bunch of methods to draw the images individually. This seems counter intuitive to me. There is probably some reason for it that is beyond my limited knowledge.

There is only one "GL canvas" -- it's the Display that you see. Unless you use an AWT container, which you generally shouldn't need.

Slick has some horrible design errors, like Image rendering logic inside of the Image class. For a cleaner API and stronger control over GL, shaders, vertex buffers, etc. you should use LibGDX.

That is the thing, for this game, for a first effort, I don't need or want stronger control over OpenGL. When I get to be a Knight on here, I will probably want that then. I have a ways to go. This game, an old school RPG does just fine under Slick2D.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org