O'Reilly logo

Slick2D Game Development by Jacob Bevilacqua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing images

In Slick2D one of the most important uses of the initiation method is loading images. We will go over images and how to render them in Chapter 4, A deeper look at rendering, but for now we will learn how to load them into the game.

Slick2D has its own image class separate from the image class located in pure Java. One mistake developers make when working with Slick2D is choosing the wrong image class. The Java image class is located in a package written as java.awt.Image. The image class we will be using with Slick2D is in a package written as org.newdawn.slick.Image.

Tip

When creating a Slick2D image we must import the package org.newdawn.slick.Image.

To create a new Slick2D image we must perform the following tasks:

  • Import the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required