<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>http://slick.ninjacave.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sigtau</id>
		<title>Slick2D Wiki - User contributions [en-gb]</title>
		<link rel="self" type="application/atom+xml" href="http://slick.ninjacave.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sigtau"/>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Special:Contributions/Sigtau"/>
		<updated>2026-05-06T17:41:25Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.4</generator>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Tutorial&amp;diff=274</id>
		<title>Tutorial</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Tutorial&amp;diff=274"/>
				<updated>2013-08-09T18:30:19Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: Redirected page to Category:Tutorials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT: [[:Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Main_Page&amp;diff=273</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Main_Page&amp;diff=273"/>
				<updated>2013-08-09T00:12:05Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick2D is an easy to use set of tools and utilities wrapped around LWJGL OpenGL bindings to make 2D Java game development easier.&lt;br /&gt;
&lt;br /&gt;
Slick2D includes support for images, animations, particles, sounds, music and much much more. Additionally there are many community based projects that add additional functionality such as entity support, theme-able widgets and box2d wrappers.&lt;br /&gt;
&lt;br /&gt;
With an active forum and new features in development Slick2D is a great choice for your 2D java game!&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;New!&amp;#039;&amp;#039;&amp;#039; All of the old wiki pages from the cokeandcode.org wiki have been ported to this wiki.  Use the search feature to find out more!&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[Setting up Slick2D with NetBeansIDE]]&lt;br /&gt;
* [[Hello World]]&lt;br /&gt;
* [[Input]]&lt;br /&gt;
* [[:Category:Tutorials|...and more]]&lt;br /&gt;
&lt;br /&gt;
=Links=&lt;br /&gt;
* [http://slick.ninjacave.com/ Website]&lt;br /&gt;
* [http://slick.javaunlimited.net/ Forums]&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/ Javadoc]&lt;br /&gt;
* [https://bitbucket.org/kevglass/slick Source code repo]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=XML_Packed_SpriteSheet&amp;diff=272</id>
		<title>XML Packed SpriteSheet</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=XML_Packed_SpriteSheet&amp;diff=272"/>
				<updated>2013-08-09T00:10:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These kind of sprite sheets are generated by [https://jhulk.googlecode.com/svn-history/r60/trunk/resources/packulike/packulike.jar Pack-U-Like] (Slick2D&amp;#039;s Sprite Packer). Each XMLPackedSheet needs a base Image which contains the packed sprites and a XML-File for it&amp;#039;s description (Position, Name, etc).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Create a new Sheet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;XMLPackedSheet sheet = new XMLPackedSheet(&amp;quot;res/sheet.png&amp;quot;, &amp;quot;res/sheet.xml&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a Sprite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Image image = sheet.getImage(&amp;quot;someImage&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When images are loaded into the Pack-U-Like tool, the name of the image is set to the name of the image file which has been loaded. When referencing the image using the getImage method above, someImage refers to the image name (filename) of the image which was loaded into the packed sheet.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SpriteSheet]]&lt;br /&gt;
* [[Packed Sprite Sheets]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sprites]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=TrueType_Font_Support&amp;diff=271</id>
		<title>TrueType Font Support</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=TrueType_Font_Support&amp;diff=271"/>
				<updated>2013-08-09T00:10:13Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick has the capability to easily display True Type fonts on screen.&lt;br /&gt;
&lt;br /&gt;
True Type Fonts are loaded and rendered using the &amp;lt;code&amp;gt;org.newdawn.slick.TrueTypeFont&amp;lt;/code&amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import org.newdawn.slick.TrueTypeFont;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the full javadoc to the TrueTypeFont class [http://slick.ninjacave.com/javadoc/org/newdawn/slick/TrueTypeFont.html here].&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// initialise the font&lt;br /&gt;
Font font = new Font(&amp;quot;Verdana&amp;quot;, Font.BOLD, 20);&lt;br /&gt;
TrueTypeFont trueTypeFont = new TrueTypeFont(font, true);&lt;br /&gt;
 &lt;br /&gt;
// render some text to the screen&lt;br /&gt;
trueTypeFont.drawString(20.0f, 20.0f, &amp;quot;Slick displaying True Type Fonts&amp;quot;, Color.green);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Additional Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Anti Aliasing ===&lt;br /&gt;
&lt;br /&gt;
The second parameter to the TrueTypeFont constructor controls whether the font is [http://www.sdltutorials.com/Data/Posts/112/antialias.gif antialiased or not].&lt;br /&gt;
&lt;br /&gt;
==Loading fonts from the classpath==&lt;br /&gt;
&lt;br /&gt;
There are a number of true type fonts available on any java system. For reference, see:&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/j2se/1.5.0/docs/api/index.html?java/awt/Font.html&lt;br /&gt;
&lt;br /&gt;
Most people will also want to load custom fonts for display. Below is a short example which loads a ttf font that has been included in the programs classpath.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import org.newdawn.slick.Color;&lt;br /&gt;
import org.newdawn.slick.TrueTypeFont;&lt;br /&gt;
 &lt;br /&gt;
import java.awt.Font;&lt;br /&gt;
import java.io.BufferedInputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
 &lt;br /&gt;
public class TTFTest {&lt;br /&gt;
 &lt;br /&gt;
    public static void main(String[] args)&lt;br /&gt;
        throws LWJGLException, FontFormatException, IOException {&lt;br /&gt;
 &lt;br /&gt;
        Font font;&lt;br /&gt;
        TrueTypeFont trueTypeFont;&lt;br /&gt;
 &lt;br /&gt;
        // not included for brevity&lt;br /&gt;
        initGL();&lt;br /&gt;
 &lt;br /&gt;
        Font startFont = Font.createFont(Font.TRUETYPE_FONT,&lt;br /&gt;
    new BufferedInputStream(TTFTest.class.getClassLoader().getResourceAsStream(&lt;br /&gt;
    &amp;quot;technoid.ttf&amp;quot;)));&lt;br /&gt;
        Font baseFont = startFont.deriveFont(Font.PLAIN, 20);&lt;br /&gt;
        trueTypeFont = new TrueTypeFont(baseFont, true);&lt;br /&gt;
 &lt;br /&gt;
        while (true) {&lt;br /&gt;
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);&lt;br /&gt;
            trueTypeFont.drawString(20.0f, 20.0f, &amp;quot;this is a test&amp;quot;, Color.gray);&lt;br /&gt;
 &lt;br /&gt;
            Display.update();&lt;br /&gt;
            if (Display.isCloseRequested()) {&lt;br /&gt;
                System.exit(0);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the TrueTypeFont Class Outside of Slick ==&lt;br /&gt;
&lt;br /&gt;
You may use the TrueTypeFont class outside of the slick 2d engine. If you do this, keep in mind:&lt;br /&gt;
&lt;br /&gt;
The TrueTypeFont class assumes you are using the TextureLoader (also included in slick-util) to load and bind gl textures. See:&lt;br /&gt;
&lt;br /&gt;
* [http://web.archive.org/web/20090129084145/http://slick.cokeandcode.com/javadoc-util/index.html?org/newdawn/slick/opengl/TextureLoader.html TextureLoader]&lt;br /&gt;
* [http://web.archive.org/web/20090129084145/http://slick.cokeandcode.com/javadoc-util/index.html?org/newdawn/slick/opengl/Texture.html Texture]&lt;br /&gt;
&lt;br /&gt;
If you use your own GL methods to bind textures, TrueTypeFont may not display correctly. To ensure TrueTypeFont works, insert a call to &amp;lt;code&amp;gt;TextureImpl.bindNone()&amp;lt;/code&amp;gt; before your drawstring calls. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextureImpl.bindNone();&lt;br /&gt;
trueTypeFont.drawString(20.0f, 20.0f, &amp;quot;this is a test&amp;quot;, Color.gray);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Fonts]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=State_Based_Games&amp;diff=270</id>
		<title>State Based Games</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=State_Based_Games&amp;diff=270"/>
				<updated>2013-08-09T00:09:43Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [http://slick.ninjacave.com/javadoc/org/newdawn/slick/BasicGame.html BasicGame] class can get you a long way with simple game development. However, when games become more complicated it&amp;#039;s often useful to separate out the different parts into separate classes with logic and rendering. These different parts are referred to states, as in the state a game is in.&lt;br /&gt;
&lt;br /&gt;
In Slick this concept is supported via the Game implementation [http://slick.ninjacave.com/javadoc/org/newdawn/slick/state/StateBasedGame.html StateBasedGame]. This game implementation proxies the render and logic methods to the “current” state. The states available and current are set externally by supplying implementations of the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/state/GameState.html GameState interface]. However, a convenience implementation of State is supplied, analogous to BasicGame, named [http://slick.ninjacave.com/javadoc/org/newdawn/slick/state/BasicGameState.html BaseGameState].&lt;br /&gt;
&lt;br /&gt;
The GameState is similar to the game interface, in that it has an init, render and update methods. However, the state based game can hold multiple of these state implementation which it can then switch between. In this way the render and logic associated with each facet of the game can be separated into different classes.&lt;br /&gt;
&lt;br /&gt;
As an added bonus, when swapping between these game states a visual effect can be applied to make the swap seem more fluent. These visual effects are referred to and implemented as [http://slick.ninjacave.com/javadoc/org/newdawn/slick/state/transition/Transition.html Transitions].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/tests/StateBasedTest.html StateBasedTest] on the Slick Javadoc&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Setting_up_Slick2D_with_NetBeansIDE&amp;diff=269</id>
		<title>Setting up Slick2D with NetBeansIDE</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Setting_up_Slick2D_with_NetBeansIDE&amp;diff=269"/>
				<updated>2013-08-09T00:09:15Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
This tutorial will run you through the steps you&amp;#039;ll need to set Slick2D up with [http://www.netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
Since Slick2D uses [http://www.lwjgl.org/ LWJGL], setup is split into 2 parts, the JAR files, and the LWJGL natives (*.dll files for Windows, *.so files for Unix and Linux and *.dylib/*.jnilib for Mac).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Downloading and Extracting Slick2D and LWJGL==&lt;br /&gt;
&lt;br /&gt;
* Download [http://slick.ninjacave.com/slick.zip Slick2D]&lt;br /&gt;
* Download [http://www.lwjgl.org/download.php LWJGL] standard bundle&lt;br /&gt;
&lt;br /&gt;
* Extract the LWJGL zip (lwjgl-x.x.zip) file somewhere in your computer, remember or note down the location, you will need this later. We suggest you create a library (/lib) folder to store all these files in a well-known place. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Setting Up Slick2D and LWJGL in NetBeans==&lt;br /&gt;
&lt;br /&gt;
Extracted from [http://lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_NetBeans LWJGL with Netbeans]&lt;br /&gt;
&lt;br /&gt;
# Open up NetBeans.&lt;br /&gt;
# Go to Tools|Libraries in the main menu.&lt;br /&gt;
# Click on the New Library button.&lt;br /&gt;
# Type in Slick2D or any other name that you want for the Library Name.&lt;br /&gt;
# Select Classpath tab for your newly created Library and then click the Add JAR/Folder... button.&lt;br /&gt;
# Go to where you extracted lwjgl-X.X.zip and add the following &amp;#039;.jar&amp;#039;(&amp;#039;Ctrl&amp;#039; or &amp;#039;Alt&amp;#039; to select multiple files)&lt;br /&gt;
## lwjgl.jar&lt;br /&gt;
## slick.jar&lt;br /&gt;
## jinput.jar&lt;br /&gt;
## lwjgl_util.jar (if want to use OpenGL&amp;#039;s GLU class) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Setting Up a Project to use LWJGL in NetBeans==&lt;br /&gt;
&lt;br /&gt;
* In a new Java project: &lt;br /&gt;
&lt;br /&gt;
# Right-Click your project node or go to File&amp;gt;Project Properties and select Libraries&lt;br /&gt;
# Add your Slick2D Library , created as instructed above&lt;br /&gt;
# Select Run&lt;br /&gt;
# On VM Options put the following: &lt;br /&gt;
&lt;br /&gt;
    -Djava.library.path=&amp;lt;lwjgl-X.X path&amp;gt;/native/&amp;lt;linux|macosx|solaris|windows&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: Remember to select the natives of your operating system.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Resource_Loading&amp;diff=268</id>
		<title>Resource Loading</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Resource_Loading&amp;diff=268"/>
				<updated>2013-08-09T00:08:34Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When referencing resources ([[images]], [[SpriteSheet|spritesheets]], fonts, sounds etc.) the underlying class will use the ResourceManager to find the resource and obtain an input stream to it.&lt;br /&gt;
&lt;br /&gt;
The resource manager first tries to look the resource up using the classpath. Putting your resources in the classpath is generally the best way to work since it makes transitioning to deployment (webstart and/or applets) much easier - since the classpath is present at testing and at deployment. Note that the context class loader is used which ensure that at deployment what ever the framework being used for deployment is can specify an appropriate class loader to obtain resources.&lt;br /&gt;
&lt;br /&gt;
If the resource manager is unable to locate the resoruce within the classpath it will attempt to use the reference provided as a file name relative to the current directory. This is sometimes useful during testing. It is also possible to deploy while still being dependent on direct file reference (maybe using an installer and keeping files unjarred) but this is not recommended.&lt;br /&gt;
&lt;br /&gt;
Finally if the resource manager can not locate the resource it will report an error which may stop initialisation. It is possible that resource location can fail but still the resource can remain valid and so a resource simply not being located is not always a reason to stop init.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Deferred Resource Loading]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Resources]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Pedigree_Editor&amp;diff=267</id>
		<title>Pedigree Editor</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Pedigree_Editor&amp;diff=267"/>
				<updated>2013-08-09T00:08:06Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The particle system included with Slick is simple but very effective at providing organic looking effects. However, it can be hard to understand how to achieve these effects.&lt;br /&gt;
&lt;br /&gt;
The Pedigree particle editor was intended as a “stand in” until a more ornate and complete 2D particle system editor came along. However, as yet we&amp;#039;ve been unable to find anything that is full functional with an open specification. The Pedigree Editor is based around the XML specification that drives the Configurable Emitters.&lt;br /&gt;
&lt;br /&gt;
Pedigree (and hence the XML specification) has thus far been developed in two iterations. The first of which was intended to give basic functionality for particle effects. It allows you to define how the particles will be created (size, position, initial velocity, initial colour) and how they will change over their life time (size, colour, velocity, alpha change).&lt;br /&gt;
&lt;br /&gt;
The second iteration (referred to as Whiskas) was supplied by an active user, Void256, who added the facilities to define the change over the life time of the particles with a graph of points using linear intepolation between the values to allow more creative designs.&lt;br /&gt;
&lt;br /&gt;
The recommended way to learn to use the editor is by simply fiddling. Most users have had great success producing effects just by tweaking different configuration values. Note that this tool is provided as a stop gap and hence there isn&amp;#039;t a complete manual or much in the way of formal testing. With luck a full replacement will become available.&lt;br /&gt;
&lt;br /&gt;
One of the established “we will not dos” of Slick is the intention not to write ornate specific tools for the library - which end up taking more time that the rest of the library of useful facilities. With this in mind we&amp;#039;re still looking for a good clean replacement - if you know of one please let us know on the forums&lt;br /&gt;
&lt;br /&gt;
Example XML files are provided with the tool, however all Configurable Emitters XML files should be loadable.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://bitbucket.org/kevglass/slick/src/c0e4b96798d1c5b1969a26cb62eb7489d701ca6f/trunk/Slick/tools/org/newdawn/slick/tools/peditor?at=default Pedigree Editor source code] at BitBucket&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Overview&amp;diff=266</id>
		<title>Overview</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Overview&amp;diff=266"/>
				<updated>2013-08-09T00:07:11Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick2D is a simple set of tools wrapped around the [http://lwjgl.org/ LWJGL] OpenGL binding for Java. It&amp;#039;s aims are as follows:&lt;br /&gt;
* Provide a simple 2D API&lt;br /&gt;
* Make transition from Java2D to OpenGL easier&lt;br /&gt;
* Enable distribution via WebStart without the complexity&lt;br /&gt;
* Provide the tools required for most simple games out of the box&lt;br /&gt;
* Extensible framework for flexibility&lt;br /&gt;
* Mix and Match - you use what you want, nothing is enforced.&lt;br /&gt;
* Help with rendering, sound, input, collision and anything else we can think of.&lt;br /&gt;
&lt;br /&gt;
Here are some things we&amp;#039;re explicitly not doing and why:&lt;br /&gt;
* Abstracting the rendering method (i.e. Java2D or OpenGL). With the advent of LWJGL Applets, it&amp;#039;s a waste of time and just makes things more complicated.&lt;br /&gt;
* Take over your development - where would the fun be if the library just forced you to do everything it&amp;#039;s way?&lt;br /&gt;
* Fix everything - there will always be challenges in games development.&lt;br /&gt;
* Move to 3D eventually.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Getting Started]] guide to start your journey into slick-smooth Java game development!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Input_Handling&amp;diff=265</id>
		<title>Input Handling</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Input_Handling&amp;diff=265"/>
				<updated>2013-08-09T00:06:22Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick input can handle keyboard, mouse and controller input (mostly just wrapped carefully around the existing LWJGL functionality). The input processing is handled by the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/Input.html Input] class. To receive input you need to get an instance of this class and call &amp;lt;code&amp;gt;poll()&amp;lt;/code&amp;gt; during the game loop to check input and fire events to registered listeners. If you&amp;#039;re using the GameContainer framework then this is all handled for you and you can simply call GameContainer.getInput() (which is the preferred option).&lt;br /&gt;
&lt;br /&gt;
Input can be retrieved in two ways (discussed in later section). You can either poll the keyboard, mouse and controllers by using the direct method calls on Input such as &amp;lt;code&amp;gt;isKeyPressed()&amp;lt;/code&amp;gt;. This will give you the state of the input at any time. Alternatively you can register a listener with the Input instance you&amp;#039;re using with addListener and then implement the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/InputListener.html InputListener interface] to handle notifications of input changes. Note that if you&amp;#039;re using an extension of [http://slick.ninjacave.com/javadoc/org/newdawn/slick/BasicGame.html BasicGame] then this is done for you and you can simply override the input event handler methods.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Polling the Current Input State]]&lt;br /&gt;
* [[Event-Driven Input]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Input]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=ImageBuffer&amp;diff=264</id>
		<title>ImageBuffer</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=ImageBuffer&amp;diff=264"/>
				<updated>2013-08-09T00:05:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Normally you&amp;#039;ll load images from files in known formats. However, there are cases where you&amp;#039;d like to be able to generate an image based on a set of data you&amp;#039;ve created. Some examples are terrain and custom image loading. In Slick you have two options - either you understand the underlying image data classes and build yourself a modified one - or you use the simple [http://slick.ninjacave.com/javadoc/org/newdawn/slick/ImageBuffer.html ImageBuffer utility class].&lt;br /&gt;
&lt;br /&gt;
An ImageBuffer is set of data that can be converted to a Slick Image at a later point. However, the created image is a copy of the image buffer and hence subsequent changes to the ImageBuffer don&amp;#039;t change previously created images.&lt;br /&gt;
&lt;br /&gt;
Using the ImageBuffer is reasonably simple. Create an ImageBuffer with the appropriate size for your desired image - note that this can not be bigger than the texture size supported by your target platform (2048×2048 is a normal, but 512×512 is a safe bet). Next set the pixels in the buffer with &amp;lt;code&amp;gt;setRGBA()&amp;lt;/code&amp;gt; as required. Finally convert the buffer into an image by calling &amp;lt;code&amp;gt;getImage()&amp;lt;/code&amp;gt;. The returned image will be made up of the buffer&amp;#039;s contents converted into an OpenGL texture.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Rendering to an Image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Graphics]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=ImageBuffer&amp;diff=263</id>
		<title>ImageBuffer</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=ImageBuffer&amp;diff=263"/>
				<updated>2013-08-09T00:05:40Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Normally you&amp;#039;ll load images from files in known formats. However, there are cases where you&amp;#039;d like to be able to generate an image based on a set of data you&amp;#039;ve created. Some examples are terrain and custom image loading. In Slick you have two options - either you understand the underlying image data classes and build yourself a modified one - or you use the simple [http://slick.ninjacave.com/javadoc/org/newdawn/slick/ImageBuffer.html ImageBuffer utility class].&lt;br /&gt;
&lt;br /&gt;
An ImageBuffer is set of data that can be converted to a Slick Image at a later point. However, the created image is a copy of the image buffer and hence subsequent changes to the ImageBuffer don&amp;#039;t change previously created images.&lt;br /&gt;
&lt;br /&gt;
Using the ImageBuffer is reasonably simple. Create an ImageBuffer with the appropriate size for your desired image - note that this can not be bigger than the texture size supported by your target platform (2048×2048 is a normal, but 512×512 is a safe bet). Next set the pixels in the buffer with &amp;lt;code&amp;gt;setRGBA()&amp;lt;/code&amp;gt; as required. Finally convert the buffer into an image by calling &amp;lt;code&amp;gt;getImage()&amp;lt;/code&amp;gt;. The returned image will be made up of the buffer&amp;#039;s contents converted into an OpenGL texture.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* Rendering to an Image&lt;br /&gt;
&lt;br /&gt;
[[Category:Graphics]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Getting_Started&amp;diff=262</id>
		<title>Getting Started</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Getting_Started&amp;diff=262"/>
				<updated>2013-08-09T00:04:29Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The information below will let you know what to get and how to get it. However, the first challenge with any new API is getting some idea of where to start code wise. Most users of Slick so far have found that starting by playing with the included test examples is a good place to start understanding how things hold together. To get the tests you can download the distribution (see below) and find the tests in the org.newdawn.slick.tests package.&lt;br /&gt;
&lt;br /&gt;
==Getting the Slick Distribution==&lt;br /&gt;
&lt;br /&gt;
The Slick distribution contains a complete set of source code, test resources and tools for the library. It also contains build scripts and tests for the API. This is useful both to get a feel for how to use Slick and for making modifications to the platform to enhance how you use it. The distribution package also contains all the libraries required for deployment as webstart and applet. The distribution is available as a ZIP from:&lt;br /&gt;
&lt;br /&gt;
http://slick.ninjacave.com/slick.zip&lt;br /&gt;
&lt;br /&gt;
==Determining Your Build Version==&lt;br /&gt;
&lt;br /&gt;
The current Slick version is always displayed at the top of the website. To determine the version of your Slick JAR open it in a ZIP tool. At the root of the JAR you&amp;#039;ll find a file named “version”. This file contains a property defining the version in the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;build=75&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Slick via BitBucket==&lt;br /&gt;
&lt;br /&gt;
Slick&amp;#039;s source code and resources are stored in a central git repository. You can browse this repository using the a web client. You can also get direct read only access to the Slick git using the following git repository URL:&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/kevglass/slick&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can browse the source tree using a web browser using the link above.&lt;br /&gt;
&lt;br /&gt;
Slick development is currently closed to new developers, hence write access to the repository is not currently available. Patches and feature adds are accepted via the forums and the development is planned to open up to selected developers at a later date.&lt;br /&gt;
&lt;br /&gt;
==Building Against Slick==&lt;br /&gt;
&lt;br /&gt;
To build against Slick you require “slick.jar” in your build classpath. How this is setup varies from build environment to build environment. Refer to the documentation for your IDE to determine how this can be setup. It is also advisable to have the runtime dependencies in the build classpath while building. This will allow you to use direct access to LWJGL and other dependencies when it becomes necessary to get a finer level of control.&lt;br /&gt;
&lt;br /&gt;
==Runtime JARs and Libraries==&lt;br /&gt;
&lt;br /&gt;
When running your Slick game you need to include the libraries in the “lib” directory in your classpath. These support each of the facets of the Slick API. In addition the native libraries (DLLs on Windows, .so on Linux, jnilib on MacOSX) must be included in your native library search path.&lt;br /&gt;
&lt;br /&gt;
If you are seeing errors including the term &amp;#039;UnsatisifiedLinkError&amp;#039; when trying to run the demos or the application this always means that Java cannot find the native libraries.&lt;br /&gt;
&lt;br /&gt;
On Windows the library path includes the current directory. So if you run from the location of the DLLs they should automatically be found. However, on other platforms and if you want to use the natives from a different location you must specify the following command line argument when running Java:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-Djava.library.path=&amp;lt;the directory in which the native libraries are placed&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This argument should be placed directly after the “Java” executable name on the command line. The value specified should be the fully qualified path to the directory containing your DLLs, .so or .jnilib files. The native libraries should not be in jars. There should be no spaces in the path to the location.&lt;br /&gt;
&lt;br /&gt;
Please note that an unsatisfied linking error always indicates that the native libraries can not be found (for one reason or another). This does not relate to not being able to find JAR files which are specified separately in the classpath.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://www.cs.bsu.edu/homepages/pvg/misc/slick_eclipse_tutorial.php Setting up Slick with Eclipse]&lt;br /&gt;
* [http://ray3k.com/site/tutorials/tutorial-setup-slick-in-netbeans/ Setting up Slick with Netbeans]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Fonts&amp;diff=261</id>
		<title>Fonts</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Fonts&amp;diff=261"/>
				<updated>2013-08-09T00:03:59Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Font Rendering]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fonts]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Deferred_Resource_Loading&amp;diff=260</id>
		<title>Deferred Resource Loading</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Deferred_Resource_Loading&amp;diff=260"/>
				<updated>2013-08-09T00:03:05Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick is implicitly single threaded. The game loop is written around the concept that there is only a single thread and hence no need to worry about synchronization. One of the areas that this falls down is when loading a large amount of resources needed to be loaded. This can cause a blank screen to be displayed at start up while the single thread loads all the resource before feeding back that the game is starting to the user. One option would be to allow another thread to be running in the background to load resources - however, this is technically annoying to do while maintaining a simple API and code base.&lt;br /&gt;
&lt;br /&gt;
Slick provides a way to get this loading bar style initialization - called deferred loading. When deferred loading is enabled all the calls to load resources (images, sounds, music, fonts etc) are wrapped in the library to load only the explicit data required for the resource immediately. Each resource handle that is returned is then placed in the global [http://slick.ninjacave.com/javadoc/org/newdawn/slick/loading/LoadingList.html LoadingList]. As each part of your game requests resources, this list builds up to be a global set of resource handles for everything in the game.&lt;br /&gt;
&lt;br /&gt;
Once initialization is complete, we can then simply cycle through the loading list loading each resource. However, we can do this in a controller manner - load one resource, update the screen, load the next resource, update the screen. No one resource should take so long to load that it keeps the screen from refreshing for a significant amount of time (if it does, then the resource should probably be streamed anyway :)).&lt;br /&gt;
&lt;br /&gt;
The [http://slick.ninjacave.com/javadoc/org/newdawn/slick/tests/DeferredLoadingTest.html DeferredLoadingTest] should give you a clear view of how this intended to be used. Essentially it works like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void render(GameContainer container, Graphics g) { &lt;br /&gt;
    g.drawString(&amp;quot;Loaded: &amp;quot;+lastLoaded, 100, 100);      &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
public void update(GameContainer container, int delta) throws SlickException { &lt;br /&gt;
    if (LoadingList.get().getRemainingResources() &amp;gt; 0) { &lt;br /&gt;
        DeferredResource nextResource = LoadingList.get().getNext(); &lt;br /&gt;
        nextResource.load();&lt;br /&gt;
        lastLoaded = nextResource.getDescription();&lt;br /&gt;
    } else { &lt;br /&gt;
        // loading is complete, do normal updat ehere      &lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this solution isn&amp;#039;t perfect in practice it works for most situations, while keeping the implementation and API simple.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Resource Loading]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Resources]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Configurable_Emitters&amp;diff=259</id>
		<title>Configurable Emitters</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Configurable_Emitters&amp;diff=259"/>
				<updated>2013-08-09T00:02:25Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ConfigurableEmitter.html ConfigurableEmitters] are a generic type of [[Emitter]] that is configured by an open XML specification. These emitters can be visually designed with the [[Pedigree Editor]] and can be loaded into Slick using the ConfigurableEmitters.&lt;br /&gt;
&lt;br /&gt;
The configurable emitter description allows definition of how particles will be produced (their size, colour, location etc) and how they will change with time. An extension to the specification (and the Editor) produced by Void allows these changes to specified with multiple point interpolation - allowing wierd and wonderful changes during the lifetime of the particles.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Flame.xml ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description:&amp;#039;&amp;#039;&amp;#039; A burning flame.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;emitter imageName=&amp;quot;&amp;quot; name=&amp;quot;Flame&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnInterval enabled=&amp;quot;false&amp;quot; max=&amp;quot;100.0&amp;quot; min=&amp;quot;100.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;spawnCount enabled=&amp;quot;true&amp;quot; max=&amp;quot;20.0&amp;quot; min=&amp;quot;5.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialLife enabled=&amp;quot;false&amp;quot; max=&amp;quot;1000.0&amp;quot; min=&amp;quot;1000.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialSize enabled=&amp;quot;true&amp;quot; max=&amp;quot;25.0&amp;quot; min=&amp;quot;25.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;xOffset enabled=&amp;quot;true&amp;quot; max=&amp;quot;8.0&amp;quot; min=&amp;quot;-8.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;yOffset enabled=&amp;quot;true&amp;quot; max=&amp;quot;15.0&amp;quot; min=&amp;quot;-8.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialDistance enabled=&amp;quot;false&amp;quot; max=&amp;quot;0.0&amp;quot; min=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;speed enabled=&amp;quot;true&amp;quot; max=&amp;quot;200.0&amp;quot; min=&amp;quot;50.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;length enabled=&amp;quot;false&amp;quot; max=&amp;quot;1000.0&amp;quot; min=&amp;quot;1000.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;spread value=&amp;quot;26.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;angularOffset value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;growthFactor value=&amp;quot;50.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;gravityFactor value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;startAlpha value=&amp;quot;255.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;endAlpha value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;color&amp;gt;&lt;br /&gt;
&amp;lt;step b=&amp;quot;1.0&amp;quot; g=&amp;quot;1.0&amp;quot; offset=&amp;quot;0.0&amp;quot; r=&amp;quot;1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;step b=&amp;quot;0.0&amp;quot; g=&amp;quot;1.0&amp;quot; offset=&amp;quot;0.336&amp;quot; r=&amp;quot;1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;step b=&amp;quot;0.0&amp;quot; g=&amp;quot;0.0&amp;quot; offset=&amp;quot;1.0&amp;quot; r=&amp;quot;1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/color&amp;gt;&lt;br /&gt;
&amp;lt;/emitter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Smoke ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description:&amp;#039;&amp;#039;&amp;#039; Smoke emitting from a centerpoint&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;emitter imageName=&amp;quot;&amp;quot; name=&amp;quot;Smoke&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnInterval enabled=&amp;quot;false&amp;quot; max=&amp;quot;100.0&amp;quot; min=&amp;quot;100.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;spawnCount enabled=&amp;quot;true&amp;quot; max=&amp;quot;1.0&amp;quot; min=&amp;quot;1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialLife enabled=&amp;quot;true&amp;quot; max=&amp;quot;4000.0&amp;quot; min=&amp;quot;4000.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialSize enabled=&amp;quot;true&amp;quot; max=&amp;quot;28.0&amp;quot; min=&amp;quot;28.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;xOffset enabled=&amp;quot;false&amp;quot; max=&amp;quot;0.0&amp;quot; min=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;yOffset enabled=&amp;quot;true&amp;quot; max=&amp;quot;0.0&amp;quot; min=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;initialDistance enabled=&amp;quot;false&amp;quot; max=&amp;quot;0.0&amp;quot; min=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;speed enabled=&amp;quot;true&amp;quot; max=&amp;quot;70.0&amp;quot; min=&amp;quot;50.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;length enabled=&amp;quot;false&amp;quot; max=&amp;quot;1000.0&amp;quot; min=&amp;quot;1000.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;spread value=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;angularOffset value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;growthFactor value=&amp;quot;9.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;gravityFactor value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;startAlpha value=&amp;quot;255.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;endAlpha value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;color&amp;gt;&lt;br /&gt;
&amp;lt;step b=&amp;quot;1.0&amp;quot; g=&amp;quot;0.8&amp;quot; offset=&amp;quot;0.0&amp;quot; r=&amp;quot;0.8&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;step b=&amp;quot;0.4&amp;quot; g=&amp;quot;0.4&amp;quot; offset=&amp;quot;1.0&amp;quot; r=&amp;quot;0.4&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/color&amp;gt;&lt;br /&gt;
&amp;lt;/emitter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Basic_Setup&amp;diff=258</id>
		<title>Basic Setup</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Basic_Setup&amp;diff=258"/>
				<updated>2013-08-09T00:01:34Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1.Download Slick2D from [http://slick.ninjacave.com/slick.zip here] and LWJGL from [http://lwjgl.org/download.php here]. &amp;lt;br /&amp;gt;&lt;br /&gt;
2.Create a library in your [http://en.wikipedia.org/wiki/Integrated_development_environment IDE], call it however you want! &amp;lt;br /&amp;gt;&lt;br /&gt;
3.Include slick.jar (under the &amp;#039;&amp;#039;lib&amp;#039;&amp;#039; folder inside the slick.zip file), lwjgl.jar (under the &amp;#039;&amp;#039;jar&amp;#039;&amp;#039; folder inside the lwjgl.zip  &amp;lt;br /&amp;gt;file) and lwjgl-util (again, under the &amp;#039;&amp;#039;jar&amp;#039;&amp;#039; folder inside the lwjgl.zip file). &amp;lt;br /&amp;gt;&lt;br /&gt;
4.Create a new project in your IDE and add the library you created. &amp;lt;br /&amp;gt;&lt;br /&gt;
5.Extract the &amp;#039;&amp;#039;native&amp;#039;&amp;#039; folder from the lwjgl.zip file. &amp;lt;br /&amp;gt;&lt;br /&gt;
6.Go to your project properties (yeah, the one you created with me) and add the natives path. But how? &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adding natives in NetBeans ===&lt;br /&gt;
#Right click your project -&amp;gt; properties.&lt;br /&gt;
#Select the &amp;#039;&amp;#039;run&amp;#039;&amp;#039; category.&lt;br /&gt;
#Enter the following into VMOptions: -Djava.library.path=&amp;#039;&amp;#039;&amp;#039;&amp;lt;lwjgl-X.X path&amp;gt;&amp;#039;&amp;#039;&amp;#039;/native/&amp;#039;&amp;#039;&amp;#039;&amp;lt;linux|macosx|solaris|windows&amp;gt;&amp;#039;&amp;#039;&amp;#039; (complete needed).&lt;br /&gt;
#Cheer.&lt;br /&gt;
&lt;br /&gt;
7.Now we&amp;#039;ll try running a very simple game! The point of the game will be checking if our setup succeeded! &amp;lt;br /&amp;gt;&lt;br /&gt;
Create a main class includes the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package simpleslickgame;&lt;br /&gt;
import java.util.logging.Level;&lt;br /&gt;
import java.util.logging.Logger;&lt;br /&gt;
import org.newdawn.slick.AppGameContainer;&lt;br /&gt;
import org.newdawn.slick.BasicGame;&lt;br /&gt;
import org.newdawn.slick.GameContainer;&lt;br /&gt;
import org.newdawn.slick.Graphics;&lt;br /&gt;
import org.newdawn.slick.SlickException;&lt;br /&gt;
&lt;br /&gt;
public class SimpleSlickGame extends BasicGame {&lt;br /&gt;
&lt;br /&gt;
	public SimpleSlickGame(String gamename) {&lt;br /&gt;
		super(gamename);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(GameContainer gc) throws SlickException {&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void update(GameContainer gc, int i) throws SlickException {&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void render(GameContainer gc, Graphics g) throws SlickException {&lt;br /&gt;
		g.drawString(&amp;quot;Howdy!&amp;quot;, 10, 10);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void main(String[] args) {&lt;br /&gt;
		try {&lt;br /&gt;
			AppGameContainer appgc;&lt;br /&gt;
			appgc = new AppGameContainer(new SimpleSlickGame(&amp;quot;Simple Slick Game&amp;quot;));&lt;br /&gt;
			appgc.setDisplayMode(640, 480, false);&lt;br /&gt;
			appgc.start();&lt;br /&gt;
		} catch (SlickException ex) {&lt;br /&gt;
			Logger.getLogger(SimpleSlickGame.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
8.If everything went smooth, cheer harder.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Basic_Setup&amp;diff=257</id>
		<title>Basic Setup</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Basic_Setup&amp;diff=257"/>
				<updated>2013-08-09T00:01:03Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: Undo revision 26 by Shpitzick (talk) - Why the hell did you delete this?  It&amp;#039;s a perfectly good page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1.Download Slick2D from [http://slick.ninjacave.com/slick.zip here] and LWJGL from [http://lwjgl.org/download.php here]. &amp;lt;br /&amp;gt;&lt;br /&gt;
2.Create a library in your [http://en.wikipedia.org/wiki/Integrated_development_environment IDE], call it however you want! &amp;lt;br /&amp;gt;&lt;br /&gt;
3.Include slick.jar (under the &amp;#039;&amp;#039;lib&amp;#039;&amp;#039; folder inside the slick.zip file), lwjgl.jar (under the &amp;#039;&amp;#039;jar&amp;#039;&amp;#039; folder inside the lwjgl.zip  &amp;lt;br /&amp;gt;file) and lwjgl-util (again, under the &amp;#039;&amp;#039;jar&amp;#039;&amp;#039; folder inside the lwjgl.zip file). &amp;lt;br /&amp;gt;&lt;br /&gt;
4.Create a new project in your IDE and add the library you created. &amp;lt;br /&amp;gt;&lt;br /&gt;
5.Extract the &amp;#039;&amp;#039;native&amp;#039;&amp;#039; folder from the lwjgl.zip file. &amp;lt;br /&amp;gt;&lt;br /&gt;
6.Go to your project properties (yeah, the one you created with me) and add the natives path. But how? &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adding natives in NetBeans ===&lt;br /&gt;
#Right click your project -&amp;gt; properties.&lt;br /&gt;
#Select the &amp;#039;&amp;#039;run&amp;#039;&amp;#039; category.&lt;br /&gt;
#Enter the following into VMOptions: -Djava.library.path=&amp;#039;&amp;#039;&amp;#039;&amp;lt;lwjgl-X.X path&amp;gt;&amp;#039;&amp;#039;&amp;#039;/native/&amp;#039;&amp;#039;&amp;#039;&amp;lt;linux|macosx|solaris|windows&amp;gt;&amp;#039;&amp;#039;&amp;#039; (complete needed).&lt;br /&gt;
#Cheer.&lt;br /&gt;
&lt;br /&gt;
7.Now we&amp;#039;ll try running a very simple game! The point of the game will be checking if our setup succeeded! &amp;lt;br /&amp;gt;&lt;br /&gt;
Create a main class includes the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package simpleslickgame;&lt;br /&gt;
import java.util.logging.Level;&lt;br /&gt;
import java.util.logging.Logger;&lt;br /&gt;
import org.newdawn.slick.AppGameContainer;&lt;br /&gt;
import org.newdawn.slick.BasicGame;&lt;br /&gt;
import org.newdawn.slick.GameContainer;&lt;br /&gt;
import org.newdawn.slick.Graphics;&lt;br /&gt;
import org.newdawn.slick.SlickException;&lt;br /&gt;
&lt;br /&gt;
public class SimpleSlickGame extends BasicGame {&lt;br /&gt;
&lt;br /&gt;
	public SimpleSlickGame(String gamename) {&lt;br /&gt;
		super(gamename);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(GameContainer gc) throws SlickException {&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void update(GameContainer gc, int i) throws SlickException {&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void render(GameContainer gc, Graphics g) throws SlickException {&lt;br /&gt;
		g.drawString(&amp;quot;Howdy!&amp;quot;, 10, 10);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void main(String[] args) {&lt;br /&gt;
		try {&lt;br /&gt;
			AppGameContainer appgc;&lt;br /&gt;
			appgc = new AppGameContainer(new SimpleSlickGame(&amp;quot;Simple Slick Game&amp;quot;));&lt;br /&gt;
			appgc.setDisplayMode(640, 480, false);&lt;br /&gt;
			appgc.start();&lt;br /&gt;
		} catch (SlickException ex) {&lt;br /&gt;
			Logger.getLogger(SimpleSlickGame.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
8.If everything went smooth, cheer harder.&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Webstart&amp;diff=256</id>
		<title>Webstart</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Webstart&amp;diff=256"/>
				<updated>2013-08-08T23:59:55Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Java Webstart is a very handy way of deploying your game or application over the web. Fortunately, Slick makes it easy to enable your application for use with webstart. For more information see the Webstart Docs, or have a look at [http://web.archive.org/web/20090125183754/http://www.cokeandcode.com/webstarthowto Kev&amp;#039;s Webstart Walkthrough (archived)].&lt;br /&gt;
&lt;br /&gt;
==Creating JAR Packages==&lt;br /&gt;
&lt;br /&gt;
The first step is to package up your application into a JAR package. There are a number of ways of doing this depending on your development environment. For more information about JARs see the [http://java.sun.com/docs/books/tutorial/deployment/jar/ Java JAR Tutorial].&lt;br /&gt;
&lt;br /&gt;
=== Creating a JAR Package using the Command Line ===&lt;br /&gt;
&lt;br /&gt;
For example using the commandline, the following will create a JAR package containing all the .class files in the current folder (and any subfolders) and all the .bmp files in the subfolder images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jar cvf MyGame.jar *.class images/*.bmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you do not have to include a manifest file or specify a start up class if you are going to use the package with webstart. There are many other options available when using the jar command such as being able to update a JAR if you have made changes to some of the files contained in it. To see these options just type jar with no arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
=== Creating a JAR Package in Eclipse ===&lt;br /&gt;
&lt;br /&gt;
In Eclipse the best way to create a JAR from your application is to use the export method. Right click your project and select Export from the menu. You&amp;#039;ll then be asked how you want to export the project. Expand the Java node, select JAR file and click Next. Then you&amp;#039;ll be able to select the resources you want to include in the jar. Include all the Java classes and packages that your application needs. Then select the other resources in your filespace that your application uses such as images, sounds, particle systems etc. You might find that the filespace shown in Eclipse is not up-to-date in which case you&amp;#039;ll need to close the Export dialog and refresh your filespace by right clicking your project and clicking Refresh. Once you have selected the files you want to include in your JAR, select the export destination to store your jar file and then click Next.&lt;br /&gt;
&lt;br /&gt;
In the next screen, make sure you tick “Save the description of this JAR in the workspace”. Type in or click browse to enter a location and file name to store the settings for this export for example “MyProject/BuildJAR”. Then click Next.&lt;br /&gt;
&lt;br /&gt;
In the next screen you can either generate a manifest file automatically, or use an existing manifest file if you have already created one. You can also Select a main class for this JAR which will run when the jar itself is run. This isn&amp;#039;t necessary for Webstart though. When you click Finish, the JAR file will be built. If you see warnings then it&amp;#039;s likely that Eclipse is informing you that you have some compile warnings in your code. It should be safe to ignore these if you want.&lt;br /&gt;
&lt;br /&gt;
After you have first built your JAR in Eclipse, you will see a .jardesc in your workspace (if you don&amp;#039;t then make sure you saved the JAR description in the steps above). If you make changes to your code and you want to recreate your JAR, then simply right click on the .jardesc file and select Create JAR. If you want to include new files or remove old files from the JAR then select Open JAR Packager to change these options.&lt;br /&gt;
&lt;br /&gt;
=== Creating JARs from ZIPs ===&lt;br /&gt;
&lt;br /&gt;
An alternative way to create JARs is to create a zip archive with all the classes and resources your application needs and the simply rename the .zip to .jar. It should work fine with Webstart!&lt;br /&gt;
&lt;br /&gt;
=== Creating a JNLP ===&lt;br /&gt;
&lt;br /&gt;
In Webstart, the JNLP file is the XML file that your users download which describes all the JARs and other libraries and resources that your application needs to run. In a Slick application you only need to reference the JAR of your application and the Slick library.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;jnlp&lt;br /&gt;
  spec=&amp;quot;1.0+&amp;quot;&lt;br /&gt;
  codebase=&amp;quot;http://www.mydomain.com/games&amp;quot;&lt;br /&gt;
  href=&amp;quot;mygame.jnlp&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;information&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;My Game&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;vendor&amp;gt;My Vendor Name&amp;lt;/vendor&amp;gt;&lt;br /&gt;
    &amp;lt;homepage href=&amp;quot;http://www.mydomain.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;My Game&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;description kind=&amp;quot;short&amp;quot;&amp;gt;My Game&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;icon href=&amp;quot;icon.gif&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/information&amp;gt; &lt;br /&gt;
  &amp;lt;resources&amp;gt;&lt;br /&gt;
    &amp;lt;j2se href=&amp;quot;http://java.sun.com/products/autodl/j2se&amp;quot; version=&amp;quot;1.4+&amp;quot; max-heap-size=&amp;quot;128m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;jar href=&amp;quot;mygame.jar&amp;quot;/&amp;gt;  &lt;br /&gt;
    &amp;lt;extension href=&amp;quot;http://slick.cokeandcode.com/demos/slick.jnlp&amp;quot; version=&amp;quot;0.4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/resources&amp;gt;  &lt;br /&gt;
  &amp;lt;application-desc main-class=&amp;quot;MyMainStartupClass&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/jnlp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just use the above structure and save the xml file as a .jnlp file. Make sure you change all the details such as the codebase (the location of your jnlp and jar files), the jnlp file name, the game title, vendor and description information. You can also include an icon if you like. This should be 64x64px.&lt;br /&gt;
&lt;br /&gt;
The last few settings are the most important. Firstly the j2se tag points to the download location of the required build of Java needed to run your program. It also specifies the minimum Java version needed and will display an error if the user&amp;#039;s version is below that.&lt;br /&gt;
&lt;br /&gt;
The jar tag points to your JAR file. If you have more than one JAR file you can simply add multiple jar tags.&lt;br /&gt;
&lt;br /&gt;
The extension tag is what links your application to Slick. The slick.jnlp file includes the LWJGL libraries, the Slick library itself along with some other supporting files. You can also optionally specify a version attribute to this tag. This will make sure that your application only uses the specified version of Slick. If you want to always use the latest version of Slick, just remove this attribute.&lt;br /&gt;
&lt;br /&gt;
Finally the last option is the main-class attribute. Just set this to the class name (including the package if you&amp;#039;re using them) of your main start up class. This is the class that will be run once Webstart has finished everything else.&lt;br /&gt;
&lt;br /&gt;
== Uploading and Deploying your Application ==&lt;br /&gt;
&lt;br /&gt;
Now that you have your JAR and JNLP files created all that remains to do is to upload them to the web. For this you need a webhost that supports jnlp files. If your host runs on linux you can probably enable support for JNLPs yourself. If your host uses Windows you may have to request JNLP support to be enabled. &lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t have a host then I recommend using MyJavaServer. This service is currently exclusive to Java developers and restricts access to others by posing a Java related problem which you have to solve to obtain an account.&lt;br /&gt;
&lt;br /&gt;
With your host ready, simply upload your JAR, JNLP and any icon files you&amp;#039;re using to some location on your server. Now if you did everything right, you should be able to simply navigate to your jnlp file through your browser and the application should fire up in Webstart. If so, congratulations! You can show share your game with all your friends!&lt;br /&gt;
&lt;br /&gt;
[[Category:Deployment]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Tile_Map_Support&amp;diff=255</id>
		<title>Tile Map Support</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Tile_Map_Support&amp;diff=255"/>
				<updated>2013-08-08T23:59:22Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In 2D games the environment is quite often rendered a series of images arranged in a grid formation - this is referred to as a Tile Map. Each image is called a tile, the tile map being the laying down of a collection tiles (sometimes repeating single tiles) to form the environment. Tile Maps can be of arbitrary size and may have multiple layers of tiles. For instance, in may make sense in a top down game to have a layer of tiles for the floor, a layer of tiles for the walls and a layer for the ceiling. This allows you to render the appropriate parts of the map at the appropriate times.&lt;br /&gt;
&lt;br /&gt;
In Slick there is no generic tile map support, since it&amp;#039;s essentially drawing a set of images to form a grid. However, where appropriate tools exist Slick provides loaders and renderer for their tile map format. At the current time there is a single tile map tool supported named [http://mapeditor.org/ TileD]. This editor provides good support for layers, variable size tiles and maps. It&amp;#039;s also very easy and productive to use. See [[TileD Import and Usage]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Category:TileMaps]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=SpriteSheet&amp;diff=254</id>
		<title>SpriteSheet</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=SpriteSheet&amp;diff=254"/>
				<updated>2013-08-08T23:58:45Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sprite sheets are individual sprites (or images) put together to build one image. This is often done for performance reasons (it&amp;#039;s faster to use one image than multiple seperate small ones). Slick provides the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/SpriteSheet.html SpriteSheet] class that lets you access each of the sub-images of the sheet as seperate images easily.&lt;br /&gt;
&lt;br /&gt;
The SpriteSheet class assumed that all the images are evenly spaced. It essentially splits the source image in to an even grid and then allows access to the image in each cell of the grid as a seperate image. These images can then be combined into animations or used as individual sprites/images in game rendering.&lt;br /&gt;
&lt;br /&gt;
While the SpriteSheet class assumes that all the sprites are evenly spaced, the Packed Sprite Sheets uses a descriptor file to allow seconds to be placed a arbitrary location on the image and still be accessed as individual sprites.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Packed Sprite Sheets]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sprites]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Scalable_Vector_Graphics&amp;diff=253</id>
		<title>Scalable Vector Graphics</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Scalable_Vector_Graphics&amp;diff=253"/>
				<updated>2013-08-08T23:58:14Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scalable Vector Graphics (SVG) use XML files to describe 2d graphics. While other image formats like GIF or JPG represent images as arrays of colored pixels, SVG represents an image as a list of lines and shapes. The benefit of SVG images is that they can be cleanly scaled in size without causing aliasing (jagged or blurry edges). SVG images can be created with the open source program [http://inkscape.org/ Inkscape].&lt;br /&gt;
&lt;br /&gt;
Slick currently supports many (but not all) SVG features. Features not yet supported include:&lt;br /&gt;
&lt;br /&gt;
* Cloned objects&lt;br /&gt;
* Paths with jumps (ie shapes with multiple subshapes)&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
To display an SVG image in Slick, use the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/svg/SimpleDiagramRenderer.html SimpleDiagramRenderer] class. This will allow you to render the SVG using the primitive geometry entities provided by Slick.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SimpleDiagramRenderer svgimg = &lt;br /&gt;
   new SimpleDiagramRenderer(InkscapeLoader.load(&amp;quot;image.svg&amp;quot;));&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your game&amp;#039;s &amp;lt;code&amp;gt;render()&amp;lt;/code&amp;gt; method, the SVG&amp;#039;s own render method must be called to draw it to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void render(GameContainer container, Graphics g) throws SlickException {&lt;br /&gt;
...&lt;br /&gt;
svgimg.render(g);&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shapes within an SVG are represented by the Figure class. You can access attributes of a figure using the &amp;lt;code&amp;gt;getData()&amp;lt;/code&amp;gt; function. This can be used to obtain attributes related to how the image is rendered (colors, line widths, etc) as well as any other attributes defined in the XML describing the diagram. For example, to obtain both the fill color for the first shape in a diagram, as well as its ID, you would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Color c = svgimg.diagram.getFigure(0).getData().getAsColor(NonGeometricData.FILL);&lt;br /&gt;
String id = svgimg.diagram.getFigure(0).getData().getAttribute(&amp;quot;id&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Images]]&lt;br /&gt;
* [http://inkscape.org/ Inkscape]&lt;br /&gt;
&lt;br /&gt;
[[Category:Graphics]] [[Category:Geometry]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Rendering_to_an_Image&amp;diff=252</id>
		<title>Rendering to an Image</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Rendering_to_an_Image&amp;diff=252"/>
				<updated>2013-08-08T23:57:39Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you might want to create graphics procedurally using code. This is where rendering to an image fits perfectly.&lt;br /&gt;
&lt;br /&gt;
To render into an image you first need to create a new one and get access to its graphics context.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;private Image localImg;&lt;br /&gt;
private Graphics localImgG;&lt;br /&gt;
try {&lt;br /&gt;
	localImg = new Image(256,256);&lt;br /&gt;
	localImgG = localImg.getGraphics();&lt;br /&gt;
} catch (SlickException e) {&lt;br /&gt;
	Log.error(&amp;quot;creating local image or graphics context failed: &amp;quot; + e.getMessage());&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code fragment above creates an image of size 256 x 256 pixels and retrieves the graphics context of the image (localImgG).&lt;br /&gt;
&lt;br /&gt;
Now we are prepared to draw on the image, so let&amp;#039;s clear the image and prepare it with a background color of our choice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;localImgG.setBackground(new Color(0,0,0,0));&lt;br /&gt;
localImgG.clear();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s draw something simple like a green rectangle onto the image:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;localImgG.setColor(Color.green);&lt;br /&gt;
localImgG.drawRect(10, 10, 20, 20);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you finish drawing, you need to flush the operations to the actual context. You can then return the localImg for your game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;localImgG.flush();&lt;br /&gt;
...&lt;br /&gt;
g.drawImage(localImg, 100, 100);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But just a hint: on my machine it takes around a second to retrieve the GraphicsContext for an Image! This is of course not bearable in a game… To work around this I created a static Image and its appropriate GraphicsContext on game startup. Whenever I want to create a procedurally generated image I use the static one for all drawing commands. Finally I return a copy of the static image to be used in my game code. And this is fast enough. It works like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Image img = new Image(width, height);&lt;br /&gt;
localImgG.copyArea(img, 0, 0);&lt;br /&gt;
return img;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Graphics]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Particle_Engine&amp;diff=251</id>
		<title>Particle Engine</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Particle_Engine&amp;diff=251"/>
				<updated>2013-08-08T23:57:07Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A particle engine is a collection of small sprites that each move independently based on the properties assigned by the overall engine to which the particles belong. The properties of the particle control have they move, grow and change in appearance. They also describe the state the particle are initialized in. These values are often based on pseduo-random numbers which leads to effects that tend to look more organic and unique than with canned animations.&lt;br /&gt;
&lt;br /&gt;
Slick provides a simple particle engine designed to produce 2D organic effects. The [http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ParticleSystem.html ParticleSystem] class provides the central repository for all particles. This system is a collection of particles and [http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ParticleEmitter.html ParticleEmitter] implementations which are responsible for causing the production and change of particles during their life time.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/tests/ParticleTest.html ParticleTest] on the Slick Javadoc&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=User:Sigtau&amp;diff=250</id>
		<title>User:Sigtau</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=User:Sigtau&amp;diff=250"/>
				<updated>2013-08-08T23:56:29Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, my name is Will Preston, and I&amp;#039;m a CG artist, hobbyist programmer, and budding game developer.&lt;br /&gt;
&lt;br /&gt;
I found the old Slick Wiki in a web archive and I used this account to port all of the old Slick wiki info onto the new wiki, because I love this library and I don&amp;#039;t want to see it fail--hopefully the port should benefit new users.&lt;br /&gt;
&lt;br /&gt;
Check out my work at [http://sigmatauproductions.com/ my blog].  Happy coding!&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Input&amp;diff=249</id>
		<title>Input</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Input&amp;diff=249"/>
				<updated>2013-08-08T23:55:21Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick2D input can handle keyboard, mouse and controller input (mostly just wrapped carefully around the existing LWJGL functionality).&lt;br /&gt;
&lt;br /&gt;
The input processing is handled by the Input class. To receive input you need to get an instance of this class and call poll() during the game loop to check input and fire events to registered listeners.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using the GameContainer framework then this is all handled for you and you can simply call gameContainer.getInput() (which is the preferred option).&lt;br /&gt;
&lt;br /&gt;
There are 2 ways to handle input: You can either poll the keyboard, mouse and controllers by using the direct method calls on Input such as isKeyDown(). This will give you the state of the input at any time.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can register a listener with the Input instance you&amp;#039;re using with addListener and then implement the InputListener interface to handle notifications of input changes. Note that if you&amp;#039;re using an extension of BasicGame then this is done for you and you can simply override the input event handler methods.&lt;br /&gt;
&lt;br /&gt;
==Input polling==&lt;br /&gt;
&lt;br /&gt;
Polling the input allows you to check the state of the input devices at a given moment in time.This is suitable for cases where you&amp;#039;re expecting the player to hold a button/key down while something happens in game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, hold left arrow key to run left. The key can be simply polled from the game loop. However, the downside is that if the game loop isn&amp;#039;t running quickly enough the input may miss changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance if the user were to tap left and the tap occurred while your game was rendering it may be missed. When short lived input is expected it may be more suitable to use the event based input.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Mouse====&lt;br /&gt;
&lt;br /&gt;
Mouse input can be checked by using the isMouseButtonDown() method to check the buttons and getMouseX() and getMouseY() to check positional information. Note that the mouse position has it&amp;#039;s origin (0,0) in the top left hand corner of the display unlike OpenGL. This is down to author discretion rather than any desperate need.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Keyboard====&lt;br /&gt;
&lt;br /&gt;
Keyboard state can be polled using the isKeyDown() method on the Input class. The identifier of the key to check should be supplied and these identifiers are defined within the Input class. For instance to check if space is pressed you do the following:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
input.isKeyDown(Input.KEY_SPACE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
&lt;br /&gt;
An arbitrary number of gamepads and joysticks are support. At initialisation the controllers are detected and assigned IDs. The controller directional and button state can be polled using the isButtonXPressed() methods and the isControllerXXXX() for directional control. For instance if we&amp;#039;d like to check if the controller was pushed left and button 1 was pressed the following code can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
// note we&amp;#039;re specifying controller ID zero here, using BasicGame you can&lt;br /&gt;
// check all the controller in one sweep&lt;br /&gt;
if (input.isControllerLeft(0) &amp;amp;&amp;amp; input.isButton1Pressed(0)) {&lt;br /&gt;
  // fire the big guns here!&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputTest.java See the input test]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Event based input==&lt;br /&gt;
&lt;br /&gt;
In some cases it makes sense to be notified when input changes occur. The most obvious case is when implementing a GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s important that key presses aren&amp;#039;t missed (which could happen if you poll input) and the GUI is also generally event driven. The InputListener defines a set of methods that can be implemented to receive notifications of input events from an Input instance by adding a listener using addListener().&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that if you&amp;#039;re using a subclass of basic game that it already implements InputListener and hence you can simply override the interface methods from the BasicGame class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Mouse====&lt;br /&gt;
&lt;br /&gt;
Mouse events are reported to the input listener through the following methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void mouseMoved(int oldx, int oldy, int newx, int newy)&lt;br /&gt;
public void mousePressed(int button, int x, int y)&lt;br /&gt;
public void mouseReleased(int button, int x, int y)&lt;br /&gt;
public void mouseWheelMoved(int change)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What the methods are indicating when they&amp;#039;re called should be fairly self explanatory, however it is worth mentioning that the origin of the screen for mouse coordinates is the top left - unlike that of OpenGL which uses bottom left. This means if the mouse is clicked at the top of the screen the mousePressed() method will be called with a y value of zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Keyboard====&lt;br /&gt;
&lt;br /&gt;
Keyboard events are reported each time a key is pressed and release to the following two methods on the InputListener interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void keyPressed(int key, char c)&lt;br /&gt;
public void keyReleased(int key, char c)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that both the key code and the character representing that key are reported. The character will only be reported for keys that can be visualised, a value of zero will be reported for other keys (like CTRL, ALT, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
&lt;br /&gt;
As with keyboard and mouse, connected game controllers will report events as buttons and directional controls are pressed. The following input listener methods will be called when controllers are manipulated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void controllerButtonPressed(int controller, int button)&lt;br /&gt;
public void controllerButtonReleased(int controller, int button)&lt;br /&gt;
public void controllerDownPressed(int controller)&lt;br /&gt;
public void controllerDownReleased(int controller)&lt;br /&gt;
public void controllerLeftPressed(int controller)&lt;br /&gt;
public void controllerLeftReleased(int controller)&lt;br /&gt;
public void controllerRightPressed(int controller)&lt;br /&gt;
public void controllerRightReleased(int controller)&lt;br /&gt;
public void controllerUpPressed(int controller)&lt;br /&gt;
public void controllerUpReleased(int controller)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each event method includes the index of the controller on which the change was detected. Basic game also provides this state as protected member variables. Controller input on events is a very special case. In nearly all cases polling controllers state is more appropriate than relying on the input listener.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use a controller, you need to add Jinput.jar to your classpath. When your game does not use a controller you can remove Jinput.jar and disable support for controllers:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
Input.disableControllers();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Within Update====&lt;br /&gt;
&lt;br /&gt;
The following methods are included in Input for your convenience, and can be used to check for event-driven input within the update method. Calling them will clear their state. So they should only be called once per frame.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
input.isKeyPressed(Input.KEY_SPACE);&lt;br /&gt;
input.isMousePressed(0);&lt;br /&gt;
input.isControlPressed(0); //if LEFT is pressed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that isControlPressed uses different indices than isButtonPressed, this is because isControlPressed checks for directional first with indices 0, 1, 2, 3 and LEFT, RIGHT, UP, DOWN, respectively. So, isControlPressed(4) checks to see if button 1 is pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputProviderTest.java?at=default See the input test]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abstract Input==&lt;br /&gt;
&lt;br /&gt;
The InputProvider binds abstract physical device controls (keyboard, mouse or game controller) to arbitrary objects which implement Command. When one of the input sources triggers, an event is fired indicating that a command should be enacted.&lt;br /&gt;
&lt;br /&gt;
This allows you to separate the game commands from the configured controls.&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
&lt;br /&gt;
First you have to create a Command object:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
private Command attack = new BasicCommand(&amp;quot;attack&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you define the inputs for that command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        public void init(GameContainer container) throws SlickException {&lt;br /&gt;
                provider = new InputProvider(container.getInput());&lt;br /&gt;
                provider.addListener(this);&lt;br /&gt;
                provider.bindCommand(new KeyControl(Input.KEY_SPACE), attack);&lt;br /&gt;
                provider.bindCommand(new MouseButtonControl(0), attack);&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The attack command is triggered when: Space is pressed&lt;br /&gt;
&lt;br /&gt;
The left mouse button is pressed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        public void controlPressed(Command command) {&lt;br /&gt;
                message = &amp;quot;Pressed: &amp;quot;+command;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public void controlReleased(Command command) {&lt;br /&gt;
                message = &amp;quot;Released: &amp;quot;+command;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
* [https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputProviderTest.java?at=default See the input test]&lt;br /&gt;
&lt;br /&gt;
[[Category:Input]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Image&amp;diff=248</id>
		<title>Image</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Image&amp;diff=248"/>
				<updated>2013-08-08T23:54:20Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Images]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Geometry&amp;diff=247</id>
		<title>Geometry</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Geometry&amp;diff=247"/>
				<updated>2013-08-08T23:53:49Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick provides some simple geometry classes in the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/geom/package-frame.html org.newdawn.slick.geom] package. These classes were originally intended for basic collision detection but the basic rendering Graphics class has been extended to include rendering of the primitives at user&amp;#039;s request.&lt;br /&gt;
&lt;br /&gt;
It is not recommended that you render using primitives like rectangles, circles and polygons. While it is possible to render these shapes it isn&amp;#039;t particularly efficient to do so in OpenGL especially as lines and so it&amp;#039;s recommended that you use images where possible.&lt;br /&gt;
&lt;br /&gt;
The following shapes are implemented/being implemented:&lt;br /&gt;
&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/geom/Circle.html Circle]&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/geom/Rectangle.html Rectangle]&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/geom/Polygon.html Polygon]&lt;br /&gt;
* [http://slick.ninjacave.com/javadoc/org/newdawn/slick/geom/Line.html Line]&lt;br /&gt;
&lt;br /&gt;
Each of these shapes is designed to be used (eventually) for collision though at the current time they&amp;#039;re under development. Note that by far the most efficient collision checking to be using is circle vs circle, so where possible it&amp;#039;s recommended you use circles or collections of circle to approximate your collision shapes.&lt;br /&gt;
&lt;br /&gt;
[[Category:Geometry]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Input&amp;diff=246</id>
		<title>Input</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Input&amp;diff=246"/>
				<updated>2013-08-08T23:53:18Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slick2D input can handle keyboard, mouse and controller input (mostly just wrapped carefully around the existing LWJGL functionality).&lt;br /&gt;
&lt;br /&gt;
The input processing is handled by the Input class. To receive input you need to get an instance of this class and call poll() during the game loop to check input and fire events to registered listeners.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using the GameContainer framework then this is all handled for you and you can simply call gameContainer.getInput() (which is the preferred option).&lt;br /&gt;
&lt;br /&gt;
There are 2 ways to handle input: You can either poll the keyboard, mouse and controllers by using the direct method calls on Input such as isKeyDown(). This will give you the state of the input at any time.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can register a listener with the Input instance you&amp;#039;re using with addListener and then implement the InputListener interface to handle notifications of input changes. Note that if you&amp;#039;re using an extension of BasicGame then this is done for you and you can simply override the input event handler methods.&lt;br /&gt;
&lt;br /&gt;
==Input polling==&lt;br /&gt;
&lt;br /&gt;
Polling the input allows you to check the state of the input devices at a given moment in time.This is suitable for cases where you&amp;#039;re expecting the player to hold a button/key down while something happens in game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, hold left arrow key to run left. The key can be simply polled from the game loop. However, the downside is that if the game loop isn&amp;#039;t running quickly enough the input may miss changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance if the user were to tap left and the tap occurred while your game was rendering it may be missed. When short lived input is expected it may be more suitable to use the event based input.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Mouse====&lt;br /&gt;
&lt;br /&gt;
Mouse input can be checked by using the isMouseButtonDown() method to check the buttons and getMouseX() and getMouseY() to check positional information. Note that the mouse position has it&amp;#039;s origin (0,0) in the top left hand corner of the display unlike OpenGL. This is down to author discretion rather than any desperate need.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Keyboard====&lt;br /&gt;
&lt;br /&gt;
Keyboard state can be polled using the isKeyDown() method on the Input class. The identifier of the key to check should be supplied and these identifiers are defined within the Input class. For instance to check if space is pressed you do the following:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
input.isKeyDown(Input.KEY_SPACE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
&lt;br /&gt;
An arbitrary number of gamepads and joysticks are support. At initialisation the controllers are detected and assigned IDs. The controller directional and button state can be polled using the isButtonXPressed() methods and the isControllerXXXX() for directional control. For instance if we&amp;#039;d like to check if the controller was pushed left and button 1 was pressed the following code can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
// note we&amp;#039;re specifying controller ID zero here, using BasicGame you can&lt;br /&gt;
// check all the controller in one sweep&lt;br /&gt;
if (input.isControllerLeft(0) &amp;amp;&amp;amp; input.isButton1Pressed(0)) {&lt;br /&gt;
  // fire the big guns here!&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputTest.java See the input test]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Event based input==&lt;br /&gt;
&lt;br /&gt;
In some cases it makes sense to be notified when input changes occur. The most obvious case is when implementing a GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s important that key presses aren&amp;#039;t missed (which could happen if you poll input) and the GUI is also generally event driven. The InputListener defines a set of methods that can be implemented to receive notifications of input events from an Input instance by adding a listener using addListener().&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that if you&amp;#039;re using a subclass of basic game that it already implements InputListener and hence you can simply override the interface methods from the BasicGame class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Mouse====&lt;br /&gt;
&lt;br /&gt;
Mouse events are reported to the input listener through the following methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void mouseMoved(int oldx, int oldy, int newx, int newy)&lt;br /&gt;
public void mousePressed(int button, int x, int y)&lt;br /&gt;
public void mouseReleased(int button, int x, int y)&lt;br /&gt;
public void mouseWheelMoved(int change)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What the methods are indicating when they&amp;#039;re called should be fairly self explanatory, however it is worth mentioning that the origin of the screen for mouse coordinates is the top left - unlike that of OpenGL which uses bottom left. This means if the mouse is clicked at the top of the screen the mousePressed() method will be called with a y value of zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Keyboard====&lt;br /&gt;
&lt;br /&gt;
Keyboard events are reported each time a key is pressed and release to the following two methods on the InputListener interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void keyPressed(int key, char c)&lt;br /&gt;
public void keyReleased(int key, char c)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that both the key code and the character representing that key are reported. The character will only be reported for keys that can be visualised, a value of zero will be reported for other keys (like CTRL, ALT, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
&lt;br /&gt;
As with keyboard and mouse, connected game controllers will report events as buttons and directional controls are pressed. The following input listener methods will be called when controllers are manipulated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
public void controllerButtonPressed(int controller, int button)&lt;br /&gt;
public void controllerButtonReleased(int controller, int button)&lt;br /&gt;
public void controllerDownPressed(int controller)&lt;br /&gt;
public void controllerDownReleased(int controller)&lt;br /&gt;
public void controllerLeftPressed(int controller)&lt;br /&gt;
public void controllerLeftReleased(int controller)&lt;br /&gt;
public void controllerRightPressed(int controller)&lt;br /&gt;
public void controllerRightReleased(int controller)&lt;br /&gt;
public void controllerUpPressed(int controller)&lt;br /&gt;
public void controllerUpReleased(int controller)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each event method includes the index of the controller on which the change was detected. Basic game also provides this state as protected member variables. Controller input on events is a very special case. In nearly all cases polling controllers state is more appropriate than relying on the input listener.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use a controller, you need to add Jinput.jar to your classpath. When your game does not use a controller you can remove Jinput.jar and disable support for controllers:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
Input.disableControllers();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Within Update====&lt;br /&gt;
&lt;br /&gt;
The following methods are included in Input for your convenience, and can be used to check for event-driven input within the update method. Calling them will clear their state. So they should only be called once per frame.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
input.isKeyPressed(Input.KEY_SPACE);&lt;br /&gt;
input.isMousePressed(0);&lt;br /&gt;
input.isControlPressed(0); //if LEFT is pressed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that isControlPressed uses different indices than isButtonPressed, this is because isControlPressed checks for directional first with indices 0, 1, 2, 3 and LEFT, RIGHT, UP, DOWN, respectively. So, isControlPressed(4) checks to see if button 1 is pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputProviderTest.java?at=default See the input test]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abstract Input==&lt;br /&gt;
&lt;br /&gt;
The InputProvider binds abstract physical device controls (keyboard, mouse or game controller) to arbitrary objects which implement Command. When one of the input sources triggers, an event is fired indicating that a command should be enacted.&lt;br /&gt;
&lt;br /&gt;
This allows you to separate the game commands from the configured controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
&lt;br /&gt;
First you have to create a Command object:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:java&amp;quot;&amp;gt;&lt;br /&gt;
private Command attack = new BasicCommand(&amp;quot;attack&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you define the inputs for that command:&lt;br /&gt;
&lt;br /&gt;
        public void init(GameContainer container) throws SlickException {&lt;br /&gt;
                provider = new InputProvider(container.getInput());&lt;br /&gt;
                provider.addListener(this);&lt;br /&gt;
                provider.bindCommand(new KeyControl(Input.KEY_SPACE), attack);&lt;br /&gt;
                provider.bindCommand(new MouseButtonControl(0), attack);&lt;br /&gt;
        }&lt;br /&gt;
The attack command is triggered when:&lt;br /&gt;
&lt;br /&gt;
Space is pressed&lt;br /&gt;
The left mouse button is pressed&lt;br /&gt;
&lt;br /&gt;
        public void controlPressed(Command command) {&lt;br /&gt;
                message = &amp;quot;Pressed: &amp;quot;+command;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public void controlReleased(Command command) {&lt;br /&gt;
                message = &amp;quot;Released: &amp;quot;+command;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/kevglass/slick/src/9d7443ec33af/trunk/Slick/src/org/newdawn/slick/tests/InputProviderTest.java?at=default See the input test]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Font_Rendering&amp;diff=245</id>
		<title>Font Rendering</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Font_Rendering&amp;diff=245"/>
				<updated>2013-08-08T23:52:37Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are currently two implementations of font rendering in Slick, both complying to one common Font interface. This interface allows us to render the text and also to determine the size and spacing of characters within that font (allowing for justification). The two implementations currently available are bitmap based - this provides fast convenient rendering but does not allow smooth scaling. A glyph rendering approach directly liked to true type fonts may be provided later.&lt;br /&gt;
&lt;br /&gt;
== AngelCode Fonts ==&lt;br /&gt;
&lt;br /&gt;
The wonderful folks at [http://angelcode.com/ AngelCode] provide the Bitmap Font Generator (see below) which can be used to produce textures filled with the characters from a font. The tools also produces a descriptor file which defined the positions of the font characters and the associated [http://en.wikipedia.org/wiki/Kerning kerning] values (kerning defines how characters should be placed next to each other for smooth looking paragraphs).&lt;br /&gt;
&lt;br /&gt;
Slick provides the font implementation [http://slick.ninjacave.com/javadoc/org/newdawn/slick/AngelCodeFont.html AngelCodeFont] which is responsible for loading both the texture and descriptor file and making the font itself available to be rendered. The benefits of AngelCode font is flexibility, ease of use and kerning support. However, AngelCode font support in Slick can be slightly slower than the alternatives due to the need to account for kerning when rendering text.&lt;br /&gt;
&lt;br /&gt;
== Sprite Sheet Fonts == &lt;br /&gt;
&lt;br /&gt;
The alternative approach is to use evenly spaced fonts, where the font texture is split into an even grid and each character is placed within a cell. The font implementation [[SpriteSheetFont]] provides a way to load a texture with a given spacing and use it as a font.&lt;br /&gt;
&lt;br /&gt;
While this is slightly faster than using AngelCode generated font it does not support kerning and it is advised that where large paragraphs of text are to be displayed that AngelCode fonts are used in preference.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [http://www.angelcode.com/products/bmfont/ Bitmap Font Generator]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fonts]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Emitter&amp;diff=244</id>
		<title>Emitter</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Emitter&amp;diff=244"/>
				<updated>2013-08-08T23:51:44Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Emitters]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Emitters&amp;diff=243</id>
		<title>Emitters</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Emitters&amp;diff=243"/>
				<updated>2013-08-08T23:51:19Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ParticleEmitter.html ParticleEmitters] are added to a [http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ParticleSystem.html ParticleSystem] to control the production of particles and how they change over their life time. There are two key methods in the ParticlEmitter interface. First, we have &amp;lt;code&amp;gt;update()&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void update(ParticleSystem system, int delta)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method should be used to create particles. It&amp;#039;s called every time particle system which the emitter belongs to is updated. The emitter is responsible for calling methods on ParticleSystem and the Particle class itself to create and configure particles for the effect the emitter is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
The second important method is &amp;lt;code&amp;gt;updateParticle()&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void updateParticle(Particle particle, int delta)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method is called every time the particle system is updated for every particle that was created as owned by the emitter (part of the particle creation parameters). The emitter is responsible for updating the particles based on the passing of their life. Often this method is left blank as it&amp;#039;s possible to set a velocity on a particle which will take effect without any code in this update method.&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Custom_Configurable_Emitters&amp;diff=242</id>
		<title>Custom Configurable Emitters</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Custom_Configurable_Emitters&amp;diff=242"/>
				<updated>2013-08-08T23:50:23Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may have found that the particle effects made possible by Configurable Emitters just don&amp;#039;t provide enough customisation to provide the effect that you want. For example, what if you want to implement collision detection in your emitter? You could do this by simply creating a subclass of a ConfigurableEmitter to implement these more advanced properties. But what if you also what to be able to load particle system settings from an XML file using the ParticleIO class? The ParticleIO class doesn&amp;#039;t know about your custom subclass so it&amp;#039;s unable to return an instance of it when it loads settings from an XML file. This is where the ConfigurableEmitterFactory comes in. This article will explain what it is and how to use it to create more advanced custom particle effects.&lt;br /&gt;
&lt;br /&gt;
== The ConfigurableEmitterFactory ==&lt;br /&gt;
&lt;br /&gt;
The [http://slick.ninjacave.com/javadoc/org/newdawn/slick/particles/ConfigurableEmitterFactory.html ConfigurableEmitterFactory] is an interface which describes a method called createEmitter() which returns a [[Configurable Emitter]], or any subclass of a ConfigurableEmitter. When you create a subclass of a ConfigurableEmitter you must also create a ConfigurableEmitterFactory and then pass this on to the ParticleIO class so it is able to return a ConfigurableEmitter of any subclass that you specify.&lt;br /&gt;
&lt;br /&gt;
In fact this is less complicated than it sounds. The best way to do this is to subclass the ConfigurableEmitter and implement the ConfigurableEmitterFactory interface in the same class. In this class there will be the createEmitter() method along with any overloaded methods of the ConfigurableEmitter class to provide custom functionality. Here is an example of an emitter that accepts a Boundary object in its constructor which it uses to then provide collision detection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import org.newdawn.slick.particles.ConfigurableEmitter;&lt;br /&gt;
import org.newdawn.slick.particles.ConfigurableEmitterFactory;&lt;br /&gt;
import org.newdawn.slick.particles.Particle;&lt;br /&gt;
&lt;br /&gt;
public class DynamicEmitter extends ConfigurableEmitter implements ConfigurableEmitterFactory{&lt;br /&gt;
&lt;br /&gt;
	private Boundary boundary;&lt;br /&gt;
	&lt;br /&gt;
	//The method required by the ConfigurableEmitterFactory interface&lt;br /&gt;
	public ConfigurableEmitter createEmitter(String name) {&lt;br /&gt;
		return this;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public DynamicEmitter(Boundary boundary) {&lt;br /&gt;
		super(&amp;quot;dynamicemitter&amp;quot;);&lt;br /&gt;
		this.boundry = boundary;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public void updateParticle(Particle particle, int delta) {&lt;br /&gt;
		super.updateParticle(particle, delta);&lt;br /&gt;
&lt;br /&gt;
		//Check for collisions&lt;br /&gt;
		if (boundry.checkCollision(particle.getX(), particle.getY())) {&lt;br /&gt;
			particle.setVelocity(0, 0);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use this class you simply pass an instance of it to the ParticleIO class when loading a particle system from an XML file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DynamicEmitter myCustomEmitter = new DynamicEmitter(boundry);&lt;br /&gt;
ParticleSystem = ParticleIO.loadConfiguredSystem(&amp;quot;emitters/custom.xml&amp;quot;, myCustomEmitter);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Particles]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Color_Image_System&amp;diff=241</id>
		<title>Color Image System</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Color_Image_System&amp;diff=241"/>
				<updated>2013-08-08T23:49:52Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Note that this system as not been accepted yet. As such all information in here is subject to change or removal.&lt;br /&gt;
&lt;br /&gt;
This system consists of four classes:&lt;br /&gt;
&lt;br /&gt;
* ColorImageIO - Allows you to load system that was saved as an XML file.&lt;br /&gt;
* ColorImageSystem - The main class of the system. Each system of colored images is controlled from here&lt;br /&gt;
* ColorImage - Contains an Image and a ColorTimer&lt;br /&gt;
* ColorTimer - Contains all the defined colors and the timing for color switching.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
There are 2 ways to use this system.&lt;br /&gt;
=== Color Image Editor ===&lt;br /&gt;
You can use the [[Color Image Editor]] to create a system for you and then save that system to an XML file. You then use ColorImageIO to load that file at game time.&lt;br /&gt;
=== Manual Usage ===&lt;br /&gt;
To create a system manually, you first instantsiate a ColorImageSystem object for each light effect that you want. You can set the &amp;#039;x&amp;#039; and &amp;#039;y&amp;#039; display location of each system by calling setSystemX/Y. You can add an image to be displayed beneath the colored images by calling setBaseImage. For each colored image, you create a ColorImage and add it to the ColorImageSystem by calling addImage.&lt;br /&gt;
&lt;br /&gt;
ColorImage contains a single slick Image and a ColorTimer. The slick image is typically a white or grayscale image that you want to dynamically apply color to. The four important methods here are setColorTimer, setImage, setImageX/Y. The &amp;#039;x&amp;#039; and &amp;#039;y&amp;#039; coordinates of the ColorImage are used as offsets from the ColorImageSystem &amp;#039;x&amp;#039; and &amp;#039;y&amp;#039; coordiantes.&lt;br /&gt;
&lt;br /&gt;
ColorTimer contains all the colors to be displayed and controls how they will be displayed. The colors can be set to slowly change between each color with setInterpolate using true. If false is used, the colors will only switch at each timing interval. The starting color is set with setStartColor. Every other color can be added with addColor which takes a slick Color and an &amp;#039;int&amp;#039; as arguments. The int is the time, in milliseconds, at which to switch to the Color provided.&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Applets&amp;diff=240</id>
		<title>Applets</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Applets&amp;diff=240"/>
				<updated>2013-08-08T23:49:13Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Note: Due to continuing security issues in the Java browser plugin, it is advisable to avoid distributing your game in the form of an applet.  Use [[Webstart]] or simply distribute your game&amp;#039;s executable JAR.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Applet support in LWJGL is being still it&amp;#039;s early stages and so it still has some compatibility issues in certain browsers (notably Opera). However, the concensus agrees that having a full OpenGL context in an Applet leads to some great jumps forward in Java games.&lt;br /&gt;
&lt;br /&gt;
Slick allows applets in a very convienient manner. A game written originally to sit within an application game container can be easily transfered into an AppletGameContainer and hence be used an Applet. The “applet” directory of the distribution contains the required libraries and an example HTML page that will display a game as an Applet.&lt;br /&gt;
&lt;br /&gt;
== Example HTML ==&lt;br /&gt;
&lt;br /&gt;
The following HTML is used for all Slick games displayed as Applet. Note that you may have to include extra signed JARs in the archive tags depending on what libraries you use in your game:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;applet code=&amp;quot;org.newdawn.slick.AppletGameContainer&amp;quot; &lt;br /&gt;
archive=&amp;quot;slick.jar,testdata.jar,lwjgl_applet.jar,lwjgl.jar,lwjgl_util_applet.jar,natives.jar,jinput.jar&amp;quot; &lt;br /&gt;
width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;param name=&amp;quot;game&amp;quot; value=&amp;quot;org.newdawn.slick.tests.InputTest&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/applet&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The significant change required from game to game is changing the value of the parameter “game” passed into the applet. The parameter should be set to the fully qualified name of your Game implementation.&lt;br /&gt;
&lt;br /&gt;
== Known Issues ==&lt;br /&gt;
* Low specification/Old machines stutter heavily&lt;br /&gt;
* Opera often doesn&amp;#039;t show the applet at all&lt;br /&gt;
* Major security risks with the Java browser plugin has led to many users disabling the Java plugin, thus support may be spotty&lt;br /&gt;
&lt;br /&gt;
[[Category:Deployment]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Using_Slick_Utilities_Without_the_Framework&amp;diff=239</id>
		<title>Using Slick Utilities Without the Framework</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Using_Slick_Utilities_Without_the_Framework&amp;diff=239"/>
				<updated>2013-08-08T23:48:40Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page covers all information related to using the individual parts of the Slick library instead as opposed to the library as a whole, by means of the Slick-Util library, in order to interface directly with LWJGL.  You can grab the Slick-Util library from [http://slick.ninjacave.com/slick-util/ here].&lt;br /&gt;
&lt;br /&gt;
Remember: &amp;#039;&amp;#039;&amp;#039;Slick is not a game engine.&amp;#039;&amp;#039;&amp;#039;  It doesn&amp;#039;t intend to take over how you want to work or render. It&amp;#039;s intended as a set of utilities that mesh together to form the library. Each of these utilities can be used in their own right. It can act like an engine if you use the GameContainer utilities - but this isn&amp;#039;t an absolute. If you simple need something to get images on to the screen and want to manage the game loop yourself - fine! Just pick up the library and use Image. Input, Sound and Fonts among other things are all intended to be useable this way.&lt;br /&gt;
&lt;br /&gt;
So, if you want a complete solution, you can use GameContainer and have Slick manage alot for you. If you just want some utilities, Slick can help there too. More so, if you want some source code to look at to get an idea where to start with something - go ahead. The license for Slick is loose - the code running everything is intentionally simplistic so it should be easy to pick up and understand.&lt;br /&gt;
&lt;br /&gt;
Overall, let us know what you do with things - it&amp;#039;s really fun to find a new game to play in any way!&lt;br /&gt;
&lt;br /&gt;
== Texture Handling ==&lt;br /&gt;
Texture loading in Slick is designed to work directly with the [[Image]] classes. When using Slick as a set of utilities within your LWJGL game you may find it required to load textures and bind them outside of Slick (for certain custom effects, different data sources). There is one gotcha here, Slick caches the last texture it bound - so that textures aren&amp;#039;t rebound if they&amp;#039;re already current. This means that should you bind a different texture outside of the Slick framework it may confuse the rendering in Slick.&lt;br /&gt;
&lt;br /&gt;
To get round this, before you start doing your own thing with rendering in LWJGL, call the following on texture:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;texture.unbind();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will clear the internal cacheing state and allow you to do whatever you need with textures through OpenGL without contaminating your Slick rendering.&lt;br /&gt;
&lt;br /&gt;
== Sound with Slick-Util == &lt;br /&gt;
&lt;br /&gt;
The slick-util library provides a simple and easy to use mechanism to load and play sounds via openAL.&lt;br /&gt;
&lt;br /&gt;
It supports the following formats:&lt;br /&gt;
&lt;br /&gt;
* wav&lt;br /&gt;
* aif&lt;br /&gt;
* ogg&lt;br /&gt;
* xm&lt;br /&gt;
&lt;br /&gt;
Sounds can be loaded and played as sfx and music can be streamed.&lt;br /&gt;
&lt;br /&gt;
=== Basic Example ===&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s some basic code that loads an ogg file and plays it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Audio sound = AudioLoader.getAudio(&amp;quot;OGG&amp;quot;,&lt;br /&gt;
             new FileInputStream(&amp;quot;sfx/enemyHit.ogg&amp;quot;));&lt;br /&gt;
sound.playAsSoundEffect(1.0f, 1.0f, false);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a simple example, typically you would load your sounds in some sort of initialization phase, then play the sounds at points during your main game loop. It&amp;#039;s still this easy though.&lt;br /&gt;
&lt;br /&gt;
=== Native libraries and Java dependancies ===&lt;br /&gt;
&lt;br /&gt;
You need to include the openAL native libraries from the lwjgl distribution in your runtime environment for openAL to work.&lt;br /&gt;
&lt;br /&gt;
If you use ogg audio, you need to include the following jar files from the slick-util package:&lt;br /&gt;
&lt;br /&gt;
* jogg-0.0.7.jar&lt;br /&gt;
* jorbis-0.0.15.jar&lt;br /&gt;
&lt;br /&gt;
If you use Mod or XM audio you&amp;#039;ll need to include the following jar file:&lt;br /&gt;
&lt;br /&gt;
* ibxm.jar&lt;br /&gt;
&lt;br /&gt;
== Loading and Binding GL Textures ==&lt;br /&gt;
The slick-util library provides a simple and easy to use mechanism to load images into openGL textures, and a way to bind those textures while rendering.&lt;br /&gt;
&lt;br /&gt;
The texture loader supports the following graphics formats:&lt;br /&gt;
&lt;br /&gt;
* tga&lt;br /&gt;
* png&lt;br /&gt;
&lt;br /&gt;
=== Basic Example ===&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s some basic code that shows how to load a texture file and bind it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// init gl&lt;br /&gt;
Texture tex = TextureLoader.getTexture(&amp;quot;PNG&amp;quot;,&lt;br /&gt;
                new FileInputStream(&amp;quot;example.png&amp;quot;));&lt;br /&gt;
 &lt;br /&gt;
// in your render loop:&lt;br /&gt;
tex.bind();&lt;br /&gt;
 &lt;br /&gt;
// gl rendering code etc..&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TrueType Fonts with Slick-Util ==&lt;br /&gt;
Slick has the capability to easily display True Type fonts on screen.&lt;br /&gt;
&lt;br /&gt;
True Type Fonts are loaded and rendered using the org.newdawn.slick.TrueTypeFont class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;import org.newdawn.slick.TrueTypeFont;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the full javadoc to the TrueTypeFont class [http://slick.ninjacave.com/javadoc/org/newdawn/slick/TrueTypeFont.html here].&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// initialise the font&lt;br /&gt;
Font font = new Font(&amp;quot;Verdana&amp;quot;, Font.BOLD, 20);&lt;br /&gt;
TrueTypeFont trueTypeFont = new TrueTypeFont(font, true);&lt;br /&gt;
 &lt;br /&gt;
// render some text to the screen&lt;br /&gt;
trueTypeFont.drawString(20.0f, 20.0f, &amp;quot;Slick displaying True Type Fonts&amp;quot;, Color.green);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Additional Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Anti Aliasing ====&lt;br /&gt;
&lt;br /&gt;
The second parameter to the TrueTypeFont constructor controls whether the font is antialiased or not.&lt;br /&gt;
&lt;br /&gt;
==== Loading fonts from the classpath ====&lt;br /&gt;
&lt;br /&gt;
There are a number of true type fonts available on any java system. For reference, see:&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/j2se/1.5.0/docs/api/index.html?java/awt/Font.html&lt;br /&gt;
&lt;br /&gt;
Most people will also want to load custom fonts for display. Below is a short example which loads a ttf font that has been included in the programs classpath.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import org.newdawn.slick.Color;&lt;br /&gt;
import org.newdawn.slick.TrueTypeFont;&lt;br /&gt;
 &lt;br /&gt;
import java.awt.Font;&lt;br /&gt;
import java.io.BufferedInputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
 &lt;br /&gt;
public class TTFTest {&lt;br /&gt;
 &lt;br /&gt;
    public static void main(String[] args)&lt;br /&gt;
        throws LWJGLException, FontFormatException, IOException {&lt;br /&gt;
 &lt;br /&gt;
        Font font;&lt;br /&gt;
        TrueTypeFont trueTypeFont;&lt;br /&gt;
 &lt;br /&gt;
        // not included for brevity&lt;br /&gt;
        initGL();&lt;br /&gt;
 &lt;br /&gt;
        Font startFont = Font.createFont(Font.TRUETYPE_FONT,&lt;br /&gt;
    new BufferedInputStream(TTFTest.class.getClassLoader().getResourceAsStream(&lt;br /&gt;
    &amp;quot;technoid.ttf&amp;quot;)));&lt;br /&gt;
        Font baseFont = startFont.deriveFont(Font.PLAIN, 20);&lt;br /&gt;
        trueTypeFont = new TrueTypeFont(baseFont, true);&lt;br /&gt;
 &lt;br /&gt;
        while (true) {&lt;br /&gt;
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);&lt;br /&gt;
            trueTypeFont.drawString(20.0f, 20.0f, &amp;quot;this is a test&amp;quot;, Color.gray);&lt;br /&gt;
 &lt;br /&gt;
            Display.update();&lt;br /&gt;
            if (Display.isCloseRequested()) {&lt;br /&gt;
                System.exit(0);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:LWJGL]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Category:TileMaps&amp;diff=238</id>
		<title>Category:TileMaps</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Category:TileMaps&amp;diff=238"/>
				<updated>2013-08-08T23:47:55Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: Created page with &amp;quot;This category contains all pages relevant to tile maps.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This category contains all pages relevant to tile maps.&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=TileD_Import_and_Usage&amp;diff=237</id>
		<title>TileD Import and Usage</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=TileD_Import_and_Usage&amp;diff=237"/>
				<updated>2013-08-08T23:47:20Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TileD is a tile map editor written in Java and available [http://mapeditor.org/ here]. Slick provides support for loading and rendering orthographic maps created in this tool.&lt;br /&gt;
&lt;br /&gt;
The TiledMap class allows the developer to load a map, interegate the data and render the tiles to the screen. Loading the map is similar to loading images and sounds, simply construct a TiledMap class with a reference to the map to load. The map XML can specify a reference to a tileset to use on the map, this is done as a relative path. If required the constructor can take both the reference to the tile map XML and a base path to use to look up the tilset files. Assume that I keep all my resources (tilemaps and tilesets included) in a directory called “res” in my classpath an appropriate constructor would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TiledMap map = new TiledMap(&amp;quot;res/testmap.tmx&amp;quot;,&amp;quot;res&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To render this whole map we&amp;#039;d simply call the render method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;map.render();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or to render just a section of the map (maybe based on the location of the current player) the render method can take parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// render(int x, int y, int sx, int sy, int width, int height) &lt;br /&gt;
map.render(100,100,0,0,10,10);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which would render the section of the map in tiles from 0,0 to 10,10 at the screen position 100,100. This can be be very useful for performance when scroll round large tile maps.&lt;br /&gt;
&lt;br /&gt;
The other option provided when rendering is to render “lineByLine”. This option indicates that the each row of the tilemap rendering should be done seperately allowing you to render characters in the appropriate places on RPG Maker style maps. For instance, you may want to render your character before the items at a greater y axis location so that the character appears to behind some item.&lt;br /&gt;
&lt;br /&gt;
To get a chance to render between these lines you must subclass TiledMap and override the renderedLine() method. This method is a notification that a single line of the map has been rendered and gives you a chance to render character/entity sprites.&lt;br /&gt;
&lt;br /&gt;
The other extremely useful thing about Tiled maps is the ability to assign meta data to the tiles that are placed. A good example is collision - it&amp;#039;s wonderful to be able to assign a proprty to a particular tile in a generic editor that indicates the tile blocks movement.&lt;br /&gt;
&lt;br /&gt;
The Slick TiledMap support allows you to integrate the properties of a given location based on the properties assigned to the tiles in Tiled. This is a two stage process, first we must identify the ID of the tile at the given location using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// getTileId(int x, int y, int layerIndex) &lt;br /&gt;
int tileID = getTileId(10,10,0);&lt;br /&gt;
Which gets the ID of the tile at location 10,10 on layer 0. We can then use this ID to look up meta data properties like so:&lt;br /&gt;
&lt;br /&gt;
// getTileProperty(int tileID, String propertyName, String def) &lt;br /&gt;
String blocked = getTileProperty(tileID, &amp;quot;blocked&amp;quot;, &amp;quot;false&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we can specify a default value that will be returned if the specified property is not defined for the given tile ID. This makes conversion code tidier, for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;boolean blocked = &amp;quot;true&amp;quot;.equals(getTileProperty(tileID, &amp;quot;blocked&amp;quot;, &amp;quot;false&amp;quot;));&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, it&amp;#039;s worth noting that the meta data properties are not stored in a way that is suitable for high perfromance use. It much better for game development to read the properties at initialisation time and store them in some more perforant format later. Check tile properties on a per frame basis is likely to be slow.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; Slick only supports maps that are created with tilesets that use a single image for the tiles. You can have multiple tilesets, but only one image per set. Essentially, this means that animations on tiles are not supported.&lt;br /&gt;
&lt;br /&gt;
[[Category:TileMaps]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Sound_and_Music&amp;diff=236</id>
		<title>Sound and Music</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Sound_and_Music&amp;diff=236"/>
				<updated>2013-08-08T23:46:50Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sounds and music are available in a similar manner to Images. You simple construct an object of the appropriate type (either Sound or Music) with a reference to the resource to be loaded. Sound and music are seperated due to their use of source (the term OpenAL uses for channels). When a sound effect a played the next available source is selected and used to play the sound. If no source is available the sound isn&amp;#039;t played. However, music is always played on a single reserved channel which is not interferred with by the sound effects.&lt;br /&gt;
&lt;br /&gt;
== Sound FX ==&lt;br /&gt;
&lt;br /&gt;
The sound class supports loading WAVs and OGGs. Sound effects can be played, stopped and looped (useful for engine sounds). Note that if no channel is available when attempting to play a sound it will not be heard. Playing a sound in Slick is as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sound fx = new Sound(&amp;quot;res/boom.wav&amp;quot;);&lt;br /&gt;
fx.play();&lt;br /&gt;
// or fx.play(1.0f,0.5f) to set the volume and pitch of the sound effect&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also play sound effects using 3D sound to make them sound as thought they are originating from a particular location. You can do this by using playAt():&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sound fx = new Sound(&amp;quot;res/bounds.wav&amp;quot;);&lt;br /&gt;
fx.playAt(-1,0,0);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Music ==&lt;br /&gt;
&lt;br /&gt;
Music in Slick is treated in much the same manner as Sound FX with the notable exception mentioned above. Slick supports WAV, OGG and MOD/XM music tracks. Note that if you request that a music track be played or looped any music currently playing will be stopped as a side effect.&lt;br /&gt;
&lt;br /&gt;
Music can be loaded a and playing (repeatedly) like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Music music = new Music(&amp;quot;res/musicwithrocksin.ogg&amp;quot;);&lt;br /&gt;
music.loop();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
On some systems, playback of OGG files may be choppy, crackly or otherwise of poor quality. If you are hearing frequent popping and clicks in playback, it may be because you do not have the proper OpenAL drivers installed on your system.&lt;br /&gt;
&lt;br /&gt;
[[Category:Audio]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Saving_Local_Settings&amp;diff=235</id>
		<title>Saving Local Settings</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Saving_Local_Settings&amp;diff=235"/>
				<updated>2013-08-08T23:46:11Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Local settings are easy to save when you&amp;#039;re working with a local file system and no security settings. However, if you&amp;#039;re deploying via webstart you may find your game in a sandboxed environment that prevents direct file access - so how are we going to save game settings?&lt;br /&gt;
&lt;br /&gt;
Webstart provides a service referred to as Muffins (like HTTP Cookies, but for webstart). However the interface to these is fairly complex. Additionally, it&amp;#039;d be useful if when developing you could swap and change between a file based storage and a muffin based storage at deployment.&lt;br /&gt;
&lt;br /&gt;
Slick provides exactly this. The SavedState class provides methods to load and save arbitrary game properties to an abstract storage area. Underneath this storage will switch between file based or muffin based dependent on the operating environment. Note that this storage will not currently work within Applets - this is still an open issue.&lt;br /&gt;
&lt;br /&gt;
The saved state class provides methods to store numbers and string seperately. To save data simply set the data using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void setNumber(String nameOfField, double value)&lt;br /&gt;
public void setString(String nameOfField, String value)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and finally commit your data by calling save(). When loading data first get the data from the underlying implementation by calling load(). Then use the following methods to extract the previously stored data:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public double getNumber(String nameOfField)&lt;br /&gt;
public double getNumber(String nameOfField, double defaultValue)&lt;br /&gt;
public String getString(String nameOfField)&lt;br /&gt;
public String getString(String nameOfField, String defaultValue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when loading data you can specify default values. If the field name provided does not exist in the saved data then the default value is returned.&lt;br /&gt;
&lt;br /&gt;
Remember, the two storage systems (file based and muffin based) are not compatible with each other and hence if you test using file based storage your settings will not be available when you use your webstart deployment.&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Polling_the_Current_Input_State&amp;diff=234</id>
		<title>Polling the Current Input State</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Polling_the_Current_Input_State&amp;diff=234"/>
				<updated>2013-08-08T23:45:28Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Polling the input allows you to check the state of the input devices at a given momemnt in time. This suitable for cases where you&amp;#039;re expecting the player to hold a button/key down while something happens in game - for instance, hold cursor left to run left. The key can be simply polled from the game loop. However, the downside is that if the game loop isn&amp;#039;t running quickly enough the input may miss changes.. for instance if the user were to tap left and the tap occured while your game was rendering it may be missed. When short lived input is expected it may be more suitable to use the event based input.&lt;br /&gt;
&lt;br /&gt;
== Mouse ==&lt;br /&gt;
&lt;br /&gt;
Mouse input can be checked by using the &amp;lt;code&amp;gt;isMouseButtonDown()&amp;lt;/code&amp;gt; method to check the buttons and &amp;lt;code&amp;gt;getMouseX()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;getMouseY()&amp;lt;/code&amp;gt; to check positional information. Note that the mouse position has it&amp;#039;s origin &amp;lt;code&amp;gt;(0,0)&amp;lt;/code&amp;gt; in the top left hand corner of the display unlike OpenGL. This is down to author discretion rather than any desperate need.&lt;br /&gt;
&lt;br /&gt;
== Keyboard ==&lt;br /&gt;
&lt;br /&gt;
Keyboard state can be passed using the &amp;lt;code&amp;gt;isKeyDown()&amp;lt;/code&amp;gt; method on the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/Input.html Input] class. The identifier of the key to check should be supplied and these identifiers are defined within the Input class. For instance to check if space is pressed you do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;inputInstance.isKeyDown(Input.KEY_SPACE);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Controllers ==&lt;br /&gt;
&lt;br /&gt;
An arbitrary number of gamepads or joysticks are supported. At initialization the controllers are detected and assigned IDs. The controller directional and button state can be polled using the &amp;lt;code&amp;gt;isButtonXPressed()&amp;lt;/code&amp;gt; methods and the &amp;lt;code&amp;gt;isControllerXXXX()&amp;lt;/code&amp;gt; for directional control. For instance if we&amp;#039;d like to check if the controller was pushed left and button 1 was pressed the following code can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// note we&amp;#039;re specifying controller ID zero here, using BasicGame you can &lt;br /&gt;
// check all the controller is one sweep&lt;br /&gt;
if (input.isControllerLeft(0) &amp;amp;&amp;amp; input.isButton1Pressed(0)) {&lt;br /&gt;
  // fire the big guns here!&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Input Handling]]&lt;br /&gt;
* [[Event-Driven Input]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Input]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Packed_Sprite_Sheets&amp;diff=233</id>
		<title>Packed Sprite Sheets</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Packed_Sprite_Sheets&amp;diff=233"/>
				<updated>2013-08-08T23:44:51Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Basic sprite sheets are pretty useful if you&amp;#039;re building a simple set of sprites into a sheet. However, sprite sheets can get more complicated, where multiple different size sprites need to be packed into a single sheet. Doing this by hand is both hard and inefficient - luckily there&amp;#039;s a nice tool build for the job named [http://homepage.ntlworld.com/config/imagepacker/ ImagePacker].&lt;br /&gt;
&lt;br /&gt;
The image packing tools allows you to build a single image out of many smaller ones and it optimizes the layout of this sprites onto the sheet. Of course the layout of sprites is important and so the tool produces a descriptor file which defines where different named sprites are placed.&lt;br /&gt;
&lt;br /&gt;
Slick provides the [http://slick.ninjacave.com/javadoc/org/newdawn/slick/PackedSpriteSheet.html PackedSpriteSheet] class which allows you to load both the packed image and the descriptor file. The class then provides methods to get individual images from the sheet either as separate images or interpreted as an embedded sprite sheet. This allows you to utilize the packed sprites as with any other image and what&amp;#039;s more allows you to embed animation sprite sheets into larger sheets of sprites.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SpriteSheet]]&lt;br /&gt;
* [[XML Packed SpriteSheet]]&lt;br /&gt;
* [http://homepage.ntlworld.com/config/imagepacker/ ImagePacker], for packing a series of separate images into a single spritesheet&lt;br /&gt;
&lt;br /&gt;
[[Category:Sprites]] [[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Logging&amp;diff=232</id>
		<title>Logging</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Logging&amp;diff=232"/>
				<updated>2013-08-08T23:43:09Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The logging package provided by slick (&amp;lt;code&amp;gt;org.newdawn.slick.util.Log&amp;lt;/code&amp;gt;) is relatively straightforward. By default it logs all output to standard out, so everything is displayed in the console window that your game is launched from. This can be easily changed to dump info to a file. The logger is a zero setup utility so long as you want to print all messages and have them displayed in the console.&lt;br /&gt;
&lt;br /&gt;
== Basic Logging ==&lt;br /&gt;
&lt;br /&gt;
The slick logger supports four “levels” of messages. These can be used to, for instance, separate out debugging information from more critical game state errors. The four available logging levels are info, debug, warn, and error. The first two of these can be turned on and off as needed. There is a static member function of the Log class that corresponds to each logging level. These functions all take a string that is the log message.&lt;br /&gt;
&lt;br /&gt;
Here is an example using the logging class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	// ... Some code&lt;br /&gt;
	Log.info(&amp;quot;A logging message&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The basics of it are that simple. When Log.info is called it will generate a log entry similar to the following:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Wed Mar 26 22:06:30 PDT 2008 INFO:A logging message.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Logging == &lt;br /&gt;
&lt;br /&gt;
=== Logging Exceptions ===&lt;br /&gt;
&lt;br /&gt;
Although the basic logging concept provided above is useful, one area where it doesn&amp;#039;t help much is documenting exceptions. There are two other version of the Log.error method. One accepts a string representing a logging message, as above, and an Exception object. The other takes just an Exception object. These will print the logging message (if provided) and the stack trace generated by the exception. Here&amp;#039;s an example of each:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    try {	&lt;br /&gt;
    // ... Some code&lt;br /&gt;
    }&lt;br /&gt;
    catch (SlickException e1) {&lt;br /&gt;
        Log.error(&amp;quot;A slick-specific problem occurred&amp;quot;, e1);&lt;br /&gt;
    }&lt;br /&gt;
    catch (Exception e2) {&lt;br /&gt;
        Log.error(e2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally it is more useful to provide a logging message along with an exception stack trace, but if you need to log only an exception the ability is there. Here&amp;#039;s a sample of the output from a log generated with an exception:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // Assuming our exception has the message &amp;quot;A logged exception.&amp;quot;&lt;br /&gt;
    Log.error(&amp;quot;A logging message.&amp;quot; e);&lt;br /&gt;
    &lt;br /&gt;
    // Results in the following console message:&lt;br /&gt;
    Wed Mar 26 22:14:50 PDT 2008 ERROR:A logging message.&lt;br /&gt;
    Wed Mar 26 22:14:50 PDT 2008 ERROR:A logged exception.&lt;br /&gt;
    java.lang.Exception: A logged exception.&lt;br /&gt;
    	at clojure.fns.clojure.make_ant__1122.invoke(Unknown Source)&lt;br /&gt;
    	at clojure.fns.clojure.TEST_create_ant__1120.invoke(main.clj:276)&lt;br /&gt;
    	at clojure.lang.Var.invoke(Var.java:268)&lt;br /&gt;
    	at com.finiteimprobability.Invasion.keyPressed(Unknown Source)&lt;br /&gt;
    	at org.newdawn.slick.Input.poll(Input.java:877)&lt;br /&gt;
    	at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:417)&lt;br /&gt;
    	at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:344)&lt;br /&gt;
	at com.finiteimprobability.Invasion.main(Unknown Source)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the logging message is printed before the stack trace, which includes the exception message.&lt;br /&gt;
&lt;br /&gt;
== Reducing Logger Output ==&lt;br /&gt;
&lt;br /&gt;
By default the logger will print all logged messages to the log. The method Log.setVerbose takes a single boolean argument. If set to false info and debug messages will not be printed.&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Images&amp;diff=231</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Images&amp;diff=231"/>
				<updated>2013-08-08T23:42:23Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Images are the most primitive drawing tool within Slick. They are the root of most of utilities for rendering. Each image will draw a rectangular area on the screen filled with some pixels based on either a generated source (see [[ImageBuffer]]) or a image loaded from disk.&lt;br /&gt;
&lt;br /&gt;
Slick currently uses java&amp;#039;s ImageIO to load images so supports, PNG, GIF and JPG. It also supports TGA through a pure java loader which is generally much faster than using ImageIO. However, the TGA must be non-compressed and 32 bit to be loaded correctly. Note that of course resources are generally placed in JAR files and as such TGA compresses down in this context in a similar magnitude to PNG.&lt;br /&gt;
&lt;br /&gt;
As with most things in Slick images are currently rendered in the simplest manner possible, using OpenGL immediate mode. This is not the most efficient manner and hence this is subject to change at a later date (should a need arise).&lt;br /&gt;
&lt;br /&gt;
Note that fonts, sprite sheets and particles all rely on the basic image class. It&amp;#039;s also worth remember that any given texture (or extenal image) is loaded only once and hence no caching is required on the developers side. This also means that sub-images and references to the original data so memory is not duplicated. As a side effects images are considered non-mutable - i.e. they can not be changed - which may have invalidated another references rendering.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Images can be loaded and used simply by construction. To load an image ready for use the following code could be used at initialization:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Image img = new Image(&amp;quot;res/myimage.png&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The image can either be in the classpath (for webstart) or on the file system (for local testing).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Resource Loading]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]] [[Category:Graphics]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Hello_World&amp;diff=230</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Hello_World&amp;diff=230"/>
				<updated>2013-08-08T23:41:38Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To make sure your setup succeeded, create a main class like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package simpleslickgame;&lt;br /&gt;
import java.util.logging.Level;&lt;br /&gt;
import java.util.logging.Logger;&lt;br /&gt;
import org.newdawn.slick.AppGameContainer;&lt;br /&gt;
import org.newdawn.slick.BasicGame;&lt;br /&gt;
import org.newdawn.slick.GameContainer;&lt;br /&gt;
import org.newdawn.slick.Graphics;&lt;br /&gt;
import org.newdawn.slick.SlickException;&lt;br /&gt;
&lt;br /&gt;
public class SimpleSlickGame extends BasicGame&lt;br /&gt;
{&lt;br /&gt;
	public SimpleSlickGame(String gamename)&lt;br /&gt;
	{&lt;br /&gt;
		super(gamename);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(GameContainer gc) throws SlickException {}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void update(GameContainer gc, int i) throws SlickException {}&lt;br /&gt;
&lt;br /&gt;
	@Override&lt;br /&gt;
	public void render(GameContainer gc, Graphics g) throws SlickException&lt;br /&gt;
	{&lt;br /&gt;
		g.drawString(&amp;quot;Howdy!&amp;quot;, 10, 10);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void main(String[] args)&lt;br /&gt;
	{&lt;br /&gt;
		try&lt;br /&gt;
		{&lt;br /&gt;
			AppGameContainer appgc;&lt;br /&gt;
			appgc = new AppGameContainer(new SimpleSlickGame(&amp;quot;Simple Slick Game&amp;quot;));&lt;br /&gt;
			appgc.setDisplayMode(640, 480, false);&lt;br /&gt;
			appgc.start();&lt;br /&gt;
		}&lt;br /&gt;
		catch (SlickException ex)&lt;br /&gt;
		{&lt;br /&gt;
			Logger.getLogger(SimpleSlickGame.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a window opens saying &amp;#039;Howdy!&amp;#039;, your setup is fully configured and ready for development.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Category:Tutorials&amp;diff=229</id>
		<title>Category:Tutorials</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Category:Tutorials&amp;diff=229"/>
				<updated>2013-08-08T23:40:31Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: Created page with &amp;quot;This category contains tutorials for getting started in Slick2d.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This category contains tutorials for getting started in Slick2d.&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Game_Containers&amp;diff=228</id>
		<title>Game Containers</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Game_Containers&amp;diff=228"/>
				<updated>2013-08-08T23:39:01Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The concept of containers isn&amp;#039;t a particularly new one, the container provides environment in which your application (in this case a game) can run. It provides that game with a set of facilities and expects the game to comply to a certain interface. This allows the container (sometimes called the framework) to handle most of the bits of code common between all games for you - leaving you to focus on the important game logic bits and pieces.&lt;br /&gt;
&lt;br /&gt;
== Basic Functionality ==&lt;br /&gt;
&lt;br /&gt;
In the case of Slick, the container holds a Game - that is the class that is contained must comply to the Game interface. To make things even easier Slick provides a basic abstract implementation of Game which you can simply extend, called BasicGame. When extending BasicGame you&amp;#039;ll need to implement 3 methods:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;init()&amp;#039;&amp;#039;&amp;#039; - This is called when the game starts and should be used to load resources and initialise the game state.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;render()&amp;#039;&amp;#039;&amp;#039; - This method is passed a graphics content which can be used to draw to the screen. All of your game&amp;#039;s rendering should take place in this method (or in methods called from this method)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;update()&amp;#039;&amp;#039;&amp;#039; - The method is called each game loop to cause your game to update it&amp;#039;s logic. So if you have a little guy flying across the screen this is where you should make him move. This is also where you should check input and change the state of the game.&lt;br /&gt;
&lt;br /&gt;
The GameContainer itself provides methods to control the properties of the game rendering and update. For instance, the game container is where you look for controlling what resolution the game runs at and whether it&amp;#039;s in fullscreen mode. It&amp;#039;s also responsible for maintaining the game timer and loop. There are a couple of implementations of GameContainer currently available (discussed below), however where possible you should rely on the GameContainer interface - apart from of course when constructing your container where you are making an explicit decision about how your game is to be displayed.&lt;br /&gt;
&lt;br /&gt;
While the Slick game container framework is useful it doesn&amp;#039;t suit everyone. It is intended that the features of Slick can be used outside of the framework as part of a generic LWJGL game.&lt;br /&gt;
&lt;br /&gt;
== Application Game Container ==&lt;br /&gt;
&lt;br /&gt;
The application game container is the most used, it&amp;#039;s intended to run your game stand alone or as a webstart. It uses a simple a window to display the game and allows you to configure the display mode directly. It&amp;#039;s generally constructed in main and started with the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try { &lt;br /&gt;
    AppGameContainer container = new AppGameContainer(new MyGame()); &lt;br /&gt;
    container.setDisplayMode(800,600,false); &lt;br /&gt;
    container.start(); &lt;br /&gt;
} catch (SlickException e) { &lt;br /&gt;
    e.printStackTrace(); &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where the 800 and 600 specify the window resolution and the false (or true) specify whether the game should be run in fullscreen mode. Note how the container is created with an instance of the game implementation. In this way when you change containers the game itself does not need to be changed at all. This makes it very easy to make a demo version of your game available via a webpage while mainitaining the full version as a standalone application.&lt;br /&gt;
&lt;br /&gt;
== Applet Game Container ==&lt;br /&gt;
&lt;br /&gt;
The applet game container uses the recently added LWJGL Applet support to present the game as a Java Applet embedded into a webpage. This functionality is currently still being tested and developed. It is known to have issues running within Opera and on low end machines. Supporting an OpenGL context within a browser window is proving to be difficult to be make stable in all cases.&lt;br /&gt;
&lt;br /&gt;
However, for most people this is a great option and allows you deploy your game as an applet with the minimal of fuss. The Slick distribution provides the files required for applet distribution in the “applet” directory. To use your game in the applet you need to specify something similar to the following in the applet tag in the HTML:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;applet code=&amp;quot;org.newdawn.slick.AppletGameContainer&amp;quot; archive=&amp;quot;slick.jar,testdata.jar,lwjgl_applet.jar,lwjgl.jar,lwjgl_util_applet.jar,natives.jar,jinput.jar&amp;quot; &lt;br /&gt;
            width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot;&amp;gt; &lt;br /&gt;
        &amp;lt;param name=&amp;quot;game&amp;quot; value=&amp;quot;org.newdawn.slick.tests.InputTest&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;/applet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where the game parameters is replaced with the fully qualified name of your Game class and the archive list contains all the jars you require signed with an appropriate certificate. See the webstart tutorial for details on how to produce a certificate and sign the the JARs correctly.&lt;br /&gt;
&lt;br /&gt;
== Future Game Containers ==&lt;br /&gt;
&lt;br /&gt;
There are currently no other containers in development, although there are plans for a container that uses a AWT Canvas to display the game. This would allow tools developers the ability to embedded the games (and application displays) into other GUIs, much like the Pedigree Particle Editor.&lt;br /&gt;
&lt;br /&gt;
Developing a game container is resonably simple by extending the standard GameContainer class and adding the part specific to the particular rendering context. If something about the game containers provided doesn&amp;#039;t fit with the way you usually write games it&amp;#039;s often easiest to simply create a new game container that does exactly what you want rather than attempt to fit in with existing implementations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Graphics]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Event-Driven_Input&amp;diff=227</id>
		<title>Event-Driven Input</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Event-Driven_Input&amp;diff=227"/>
				<updated>2013-08-08T23:38:25Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In some cases it makes sense to be notified when input changes occur. The most obvious case is when implementing a GUI. It&amp;#039;s important that key presses aren&amp;#039;t missed (which could happen if you poll input) and GUI are also generally event driven. The InputListener defines a set of methods that can be implemented to receive notifications of input events from an Input instance by adding it using &amp;lt;code&amp;gt;addListener()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that if you&amp;#039;re using a subclass of basic game that it already implements InputListener and hence you can simply use override the interface methods from the BasicGame class.&lt;br /&gt;
&lt;br /&gt;
== Mouse ==&lt;br /&gt;
&lt;br /&gt;
Mouse events are reported to the input listener through the following methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void mouseMoved(int oldx, int oldy, int newx, int newy)&lt;br /&gt;
public void mousePressed(int button, int x, int y)&lt;br /&gt;
public void mouseReleased(int button, int x, int y)&lt;br /&gt;
public void mouseWheelMoved(int change)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What the methods are indicating when they&amp;#039;re called should be fairly self explanatory, however it is worth noting that the origin of the screen for mouse coordinates is the top left - unlike that of OpenGL which uses bottom left. This means if the mouse is clicked at the top of the screen the &amp;lt;code&amp;gt;mousePressed()&amp;lt;/code&amp;gt; method will be called with a y value of zero.&lt;br /&gt;
&lt;br /&gt;
== Keyboard ==&lt;br /&gt;
&lt;br /&gt;
Keyboard events are reported each time a key is pressed and release to the following two methods on the InputListener interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void keyPressed(int key, char c)&lt;br /&gt;
public void keyReleased(int key, char c)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that both the key code and the character represeting that key are reported. The character will only be reported for keys that can be visualised, a value of zero will be reported for other keys (like CTRL, ALT, etc).&lt;br /&gt;
&lt;br /&gt;
== Controllers ==&lt;br /&gt;
&lt;br /&gt;
As with keyboard and mouse, game controllers connected will report events as buttons and directional controls are pressed. The following input listener methods will be called when controllers are manipulated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public void controllerButtonPressed(int controller, int button)&lt;br /&gt;
public void controllerButtonReleased(int controller, int button)&lt;br /&gt;
public void controllerDownPressed(int controller)&lt;br /&gt;
public void controllerDownReleased(int controller)&lt;br /&gt;
public void controllerLeftPressed(int controller)&lt;br /&gt;
public void controllerLeftReleased(int controller)&lt;br /&gt;
public void controllerRightPressed(int controller)&lt;br /&gt;
public void controllerRightReleased(int controller)&lt;br /&gt;
public void controllerUpPressed(int controller)&lt;br /&gt;
public void controllerUpReleased(int controller)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each event method includes the index of the controller on which the change was detected. Basic game also provides this state as protected member variables. Controller input on events is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; special case. In nearly all cases polling controllers state is more appropriate than relying on the input listener.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Polling the Current Event State]]&lt;br /&gt;
* [[Event-Driven Input]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Input]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Embedding_Mozilla_Rhino&amp;diff=226</id>
		<title>Embedding Mozilla Rhino</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Embedding_Mozilla_Rhino&amp;diff=226"/>
				<updated>2013-08-08T23:37:48Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting engines have started to become very popular game development tools. They allow developers to make changes to game logic without needing to recompile, or possibly even restart, the game.&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the steps needed to get start using the Mozilla Rhino Javascript engine in your Slick-based games.&lt;br /&gt;
&lt;br /&gt;
== Getting Rhino ==&lt;br /&gt;
&lt;br /&gt;
The obvious first step is to [https://developer.mozilla.org/en-US/docs/Rhino get the Rhino distribution]. Unpack the zip file and place the js.jar file in your project. Make sure to add it to your classpath and double check your build setup to be sure the jar file is included when your program is compiled and run.&lt;br /&gt;
&lt;br /&gt;
== Running Rhino and Slick together ==&lt;br /&gt;
&lt;br /&gt;
The following program is a simple implementation of Rhino running inside a Slick game. It is pretty well commented, and should explain the necessary steps as they happen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  This file demonstrates using the Rhino Javascript engine within the&lt;br /&gt;
  Slick 2d game engine.&lt;br /&gt;
 &lt;br /&gt;
  Rhino can be found at: http://www.mozilla.org/rhino/&lt;br /&gt;
  Slick can be found at: http://slick.cokeandcode.com/&lt;br /&gt;
*/&lt;br /&gt;
 &lt;br /&gt;
import org.newdawn.slick.AppGameContainer;&lt;br /&gt;
import org.newdawn.slick.BasicGame;&lt;br /&gt;
import org.newdawn.slick.GameContainer;&lt;br /&gt;
import org.newdawn.slick.Graphics;&lt;br /&gt;
import org.newdawn.slick.Input;&lt;br /&gt;
import org.newdawn.slick.SlickException;&lt;br /&gt;
 &lt;br /&gt;
import org.mozilla.javascript.Context;&lt;br /&gt;
import org.mozilla.javascript.ScriptableObject;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
public class Rhino extends BasicGame {&lt;br /&gt;
 &lt;br /&gt;
    /*&lt;br /&gt;
      The ScriptProxy class defined here is one half of the interface&lt;br /&gt;
      between Java code and the Javascript environment. It is used to,&lt;br /&gt;
      among other things, provide access to Java objects within Rhino.&lt;br /&gt;
 &lt;br /&gt;
      The ScriptableObject class implements the majority of the&lt;br /&gt;
      Scriptable interface. The Scriptable interface is used to define&lt;br /&gt;
      functions and objects that will be available to the javascript&lt;br /&gt;
      environment.&lt;br /&gt;
    */&lt;br /&gt;
    class ScriptProxy extends ScriptableObject {&lt;br /&gt;
    	String test1;&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  This is the only method required to fully implement the&lt;br /&gt;
    	  abstract class ScriptableObject. I&amp;#039;m not sure what it is&lt;br /&gt;
    	  supposed to do. The &amp;quot;global&amp;quot; value is used in at least one&lt;br /&gt;
    	  example in the Rhino documentation.&lt;br /&gt;
	*/&lt;br /&gt;
    	public String getClassName() {&lt;br /&gt;
    	    return &amp;quot;global&amp;quot;;&lt;br /&gt;
    	}&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  Access to the &amp;quot;test&amp;quot; object in the javascript environment is&lt;br /&gt;
    	  implemented through calls to the setTest and getTest&lt;br /&gt;
    	  methods.&lt;br /&gt;
	*/&lt;br /&gt;
    	public void setTest(String str) {&lt;br /&gt;
    	    test1 = str;&lt;br /&gt;
    	}&lt;br /&gt;
 &lt;br /&gt;
    	public String getTest() {&lt;br /&gt;
    	    return test1;&lt;br /&gt;
    	}&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  A test function that can be called within the JavaScript&lt;br /&gt;
    	  environment.&lt;br /&gt;
	*/&lt;br /&gt;
    	public void testfunc(String s) {&lt;br /&gt;
	    // 	    System.out.println(&amp;quot;test function called&amp;quot;);&lt;br /&gt;
    	    System.out.println(s);&lt;br /&gt;
    	}&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    /*&lt;br /&gt;
      A Context is an instance of the javascript environment. The&lt;br /&gt;
      context is used to load and interpret .js files and interpret&lt;br /&gt;
      Javascript code as strings, among other things. In this example&lt;br /&gt;
      it is used exclusively to interpret Javascript strings.&lt;br /&gt;
    */&lt;br /&gt;
    protected Context scriptContext;&lt;br /&gt;
    protected ScriptProxy gameProxy;&lt;br /&gt;
 &lt;br /&gt;
    public void init(GameContainer container) throws SlickException {&lt;br /&gt;
    	/*&lt;br /&gt;
    	  The static method Context.enter is, apparently, the easiest&lt;br /&gt;
    	  way to obtain a javascript environment.&lt;br /&gt;
	*/&lt;br /&gt;
    	scriptContext = Context.enter();&lt;br /&gt;
    	gameProxy = new ScriptProxy();&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  We&amp;#039;ll set a string for the &amp;quot;test&amp;quot; property that will be&lt;br /&gt;
    	  exposed in Javascript now so we know it is calling across&lt;br /&gt;
    	  the bridge.&lt;br /&gt;
	*/&lt;br /&gt;
    	gameProxy.setTest(&amp;quot;This was set within java, but called from javascript.&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  This must be called before scripts can be evaluated in this&lt;br /&gt;
    	  Context. It creates some of the basic Javascript objects.&lt;br /&gt;
	*/&lt;br /&gt;
    	scriptContext.initStandardObjects(gameProxy);&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  Functions provided by a ScriptableObject (such as our&lt;br /&gt;
    	  example &amp;#039;testfunc&amp;#039;) are initialized in the following manner.&lt;br /&gt;
	*/&lt;br /&gt;
    	String[] scriptAvailableFunctions = { &amp;quot;testfunc&amp;quot; };&lt;br /&gt;
    	gameProxy.defineFunctionProperties(scriptAvailableFunctions, ScriptProxy.class, ScriptableObject.DONTENUM);&lt;br /&gt;
 &lt;br /&gt;
    	/*&lt;br /&gt;
    	  A &amp;quot;property&amp;quot; is a Javascript object that is exposed through&lt;br /&gt;
    	  getters and setters in the ScriptableObject. Rhino&lt;br /&gt;
    	  automatically prepends the &amp;quot;set&amp;quot; and &amp;quot;get&amp;quot; terms and&lt;br /&gt;
    	  uppercases the first letter, so exact naming is important.&lt;br /&gt;
	*/&lt;br /&gt;
    	gameProxy.defineProperty(&amp;quot;test&amp;quot;, ScriptProxy.class, ScriptableObject.DONTENUM);&lt;br /&gt;
 &lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void render(GameContainer container, Graphics g) {&lt;br /&gt;
    	/*&lt;br /&gt;
    	  Here we are using the context (javascript engine) to&lt;br /&gt;
    	  evaluate a string. The first parameter is our&lt;br /&gt;
    	  ScriptableObject, which is used to provide definitions for&lt;br /&gt;
    	  the engine. The second argument is the code to be evaluated.&lt;br /&gt;
    	  In this case simply writing &amp;quot;test&amp;quot; evaluates the Javascript&lt;br /&gt;
    	  object named &amp;quot;test&amp;quot;, which is looked up in our gameProxy,&lt;br /&gt;
    	  which passed the result of it&amp;#039;s getTest() method to the&lt;br /&gt;
    	  Javascript engine.&lt;br /&gt;
 &lt;br /&gt;
    	  Since this is the only instruction in the string to be&lt;br /&gt;
    	  evaluated it is used as the return value for&lt;br /&gt;
    	  evaluateString. To provide flexibility in return type&lt;br /&gt;
    	  handling evaluateString returns a java.lang.Object, which is&lt;br /&gt;
    	  why the result must be cast back into a String.&lt;br /&gt;
 &lt;br /&gt;
    	  The third parameter is a string that describes the source&lt;br /&gt;
    	  for the Javascript code being evaluated. This may be a&lt;br /&gt;
    	  filename if that is where the string comes from.&lt;br /&gt;
 &lt;br /&gt;
    	  The fourth parameter is the starting line number for this&lt;br /&gt;
    	  script, which might be useful if a script is being pieced&lt;br /&gt;
    	  together from a variety of components.&lt;br /&gt;
 &lt;br /&gt;
    	  The last parameter is used to provide a security domain for&lt;br /&gt;
    	  the script to run under. I *think* this is used to ensure&lt;br /&gt;
    	  that the Javascript code cannot execute certain methods or&lt;br /&gt;
    	  instantiate some objects, but haven&amp;#039;t done enough research&lt;br /&gt;
    	  to be sure. Passing a null value here does not restrict the&lt;br /&gt;
    	  evaluation of Javascript code.&lt;br /&gt;
	*/&lt;br /&gt;
    	String result = (String) scriptContext.evaluateString(gameProxy, &amp;quot;test;&amp;quot;, &amp;quot;js&amp;quot;, 1, null);&lt;br /&gt;
    	g.drawString(&amp;quot;Javascript result: &amp;quot; + result, 40, 120);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void update(GameContainer container, int delta) {&lt;br /&gt;
 &lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    public void keyPressed(int key, char c) {&lt;br /&gt;
    	if(key == Input.KEY_ESCAPE) {&lt;br /&gt;
    	    /*&lt;br /&gt;
    	      The script context will most likely be shut down&lt;br /&gt;
    	      properly, but it&amp;#039;s a good idea to be neat and tidy,&lt;br /&gt;
    	      right?&lt;br /&gt;
	    */&lt;br /&gt;
    	    scriptContext.exit();&lt;br /&gt;
    	    System.exit(0);&lt;br /&gt;
    	}&lt;br /&gt;
    	if(key == Input.KEY_SPACE) {&lt;br /&gt;
    	    /*&lt;br /&gt;
    	      This example is largely similar to the above, except&lt;br /&gt;
    	      that now we are calling the javascript function&lt;br /&gt;
    	      &amp;quot;testfunc()&amp;quot;. This is found and executed on gameProxy,&lt;br /&gt;
    	      printing a string to the console.&amp;quot;&lt;br /&gt;
	    */&lt;br /&gt;
    	    scriptContext.evaluateString(gameProxy, &amp;quot;testfunc(\&amp;quot;testing console output\&amp;quot;);&amp;quot;, &amp;quot;js&amp;quot;, 5, null);&lt;br /&gt;
    	}&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    public Rhino(String s) {&lt;br /&gt;
    	super(s);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public static void main(String[] Args) {&lt;br /&gt;
    	try {&lt;br /&gt;
    	    AppGameContainer container = new AppGameContainer(new Rhino(&amp;quot;Rhino&amp;quot;));&lt;br /&gt;
    	    container.setDisplayMode(600,480,false);&lt;br /&gt;
    	    //       container.setShowFPS(false);&lt;br /&gt;
    	    container.setMinimumLogicUpdateInterval(30);&lt;br /&gt;
    	    container.start();&lt;br /&gt;
    	} catch (SlickException e) {&lt;br /&gt;
	    e.printStackTrace();&lt;br /&gt;
    	}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
The next step to consider from here is how the Javascript code handles game logic updates. One simple option is to create a Javascript function named tick that your game calls every time update() runs. This in turn calls all of the functions that need to be run in Javascript on every game update.&lt;br /&gt;
&lt;br /&gt;
One obvious step to take from this point is to extend the access of the Javascript environment into your game. You don&amp;#039;t need to use an inner class to implement your ScriptableObject, and could easily have it in another file. If you already have a scene graph it probably has quite a few methods for interacting with your game environment, which might make it a good idea to turn this into a ScriptableObject and make it available to the Javascript engine.&lt;br /&gt;
&lt;br /&gt;
Since the ScriptableObject we are using also stores all of the definitions that are in scope, a second ScriptableObject can be created for a user interaction console. This allows you to expose only very specific parts of the game to the user and prevent them from directly modifying the underlying game.&lt;br /&gt;
&lt;br /&gt;
== Hot Loading Definitions ==&lt;br /&gt;
&lt;br /&gt;
One interesting use for the Javascript environment is being able to modify the game logic as the game is running. This is remarkably easy to set up. We can create a command-line input prompt that runs with the game by declaring a boolean consolePrinted member variable and adding the following code to the update method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	if(!consolePrinted) {&lt;br /&gt;
	    System.out.print(&amp;quot;rhino&amp;gt; &amp;quot;);&lt;br /&gt;
	    consolePrinted = true;&lt;br /&gt;
	}&lt;br /&gt;
	// Only parse input strings when the input buffer is empty so we&lt;br /&gt;
	// don&amp;#039;t block the game loop.&lt;br /&gt;
	if(System.in.available() != 0) {&lt;br /&gt;
	    byte[] b = new byte[System.in.available()];&lt;br /&gt;
	    System.in.read(b);&lt;br /&gt;
	    String s = new String(b);&lt;br /&gt;
	    gameProxy.setTest(s);&lt;br /&gt;
	    consolePrinted = false;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example simply alter the test property in Javascript, but we could just as easily be executing the string directly as Javascript or using it to provide a simple command system for reloading Javascript files.&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	<entry>
		<id>http://slick.ninjacave.com/wiki/index.php?title=Controlling_Game_Updates&amp;diff=225</id>
		<title>Controlling Game Updates</title>
		<link rel="alternate" type="text/html" href="http://slick.ninjacave.com/wiki/index.php?title=Controlling_Game_Updates&amp;diff=225"/>
				<updated>2013-08-08T23:37:12Z</updated>
		
		<summary type="html">&lt;p&gt;Sigtau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It&amp;#039;s important to understand that, by default, Slick calls the render() and update() method of your game on every frame. This obviously is necessary for the render() method, but may not be what you want for the update() method. Since framerates vary from one computer to another, or even from one scene to another, calling update() on every frame can make your game logic a little unpredictable.&lt;br /&gt;
&lt;br /&gt;
The GameContainer class has a built-in solution for this. It has two properties, &amp;lt;code&amp;gt;minimumLogicRate&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt;, that can be used to ensure that your update() method is executed consistently, even in the face of very low or very high framerates.&lt;br /&gt;
&lt;br /&gt;
== Using minimumLogicRate ==&lt;br /&gt;
&lt;br /&gt;
Conceptually &amp;lt;code&amp;gt;minimumLogicRate&amp;lt;/code&amp;gt; is pretty simple. It specifies an amount of time (in miliseconds) that has to pass since the last update() call before it is called again. By default &amp;lt;code&amp;gt;minimumLogicRate&amp;lt;/code&amp;gt; is set to 1, which means that your update() method is going to be called on every frame render. This may work well in testing on one particular system, but can make the game logic a bit difficult to get right on other machines. Older games often relied on the assumption that the rendering each frame took a fixed minimum amount of time. That&amp;#039;s why on current computers a lot of older games don&amp;#039;t work well, the computers are just too fast and the game logic updates too quickly.&lt;br /&gt;
&lt;br /&gt;
By raising the value of &amp;lt;code&amp;gt;minimumLogicRate&amp;lt;/code&amp;gt; you can prevent this problem. By setting it to a specific value (20 is a good initial choice) you can get consistent updates that allow your game logic to run in step with real time instead of depending on the framerate.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s pretty simple to make this change. The GameContainer class has methods named setMinimumLogicRate() and getMinimumLogicRate(), that can be used to change this value. Do this in your main function and you can go about planning your game logic without worrying about the framerate. Well, mostly. One problem we still need to deal with is if the framerate drops to the point that our update() function isn&amp;#039;t running as many times as it should. See &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; below for that.&lt;br /&gt;
&lt;br /&gt;
== Using maximumLogicRate ==&lt;br /&gt;
&lt;br /&gt;
Now that we have &amp;lt;code&amp;gt;minimumLogicRate&amp;lt;/code&amp;gt; solving any logic consistency problems we might get from too high of a framerate, we need to tackle problems due to too low of one. This can be a source of some rather nasty bugs, especially because the framerate may not drop far enough on your computer or until you get into some of the more heavy-duty scenes. If you are relying on the logic being updated every twenty milliseconds and the framerate dips so that it happens every fifty you could run into problems.&lt;br /&gt;
&lt;br /&gt;
To help handle this, Slick uses &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; to allow you to run the update code multiple times in one time through the game loop. The GameContainer looks at &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; every time through the game loop and compares it to the amount of time that has accrued since the last update() call. If that time exceeds &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; then it divides the time from the last updated by &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; and runs your update() method that many times. For instance if your &amp;lt;code&amp;gt;maximumLogicRate&amp;lt;/code&amp;gt; is set to 20 and the last update() call happened 50 miliseconds ago the game will run your update code (50 / 20 = 2.5) twice.&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Sigtau</name></author>	</entry>

	</feed>