Difference between revisions of "XML Packed SpriteSheet"

From Slick2D Wiki
Jump to: navigation, search
(Created page with "These kind of sprite sheets are generated by Pack-U-Like (Slick2D's Sprite Packer). Each XMLPackedSheet needs a base Image which contains the packed sprites and a XML-File for...")
 
(Undo revision 542 by Abc123456 (talk))
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
These kind of sprite sheets are generated by Pack-U-Like (Slick2D's Sprite Packer). Each XMLPackedSheet needs a base Image which contains the packed sprites and a XML-File for it's description (Position, Name, etc).
+
These kind of sprite sheets are generated by [https://jhulk.googlecode.com/svn-history/r60/trunk/resources/packulike/packulike.jar Pack-U-Like] (Slick2D's Sprite Packer). Each XMLPackedSheet needs a base Image which contains the packed sprites and a XML-File for it's description (Position, Name, etc).
  
 
== Usage ==
 
== Usage ==
Line 12: Line 12:
  
 
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.
 
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.
 +
 +
== See Also ==
 +
* [[SpriteSheet]]
 +
* [[Packed Sprite Sheets]]
 +
 +
[[Category:Sprites]]

Latest revision as of 13:34, 15 May 2018

These kind of sprite sheets are generated by Pack-U-Like (Slick2D's Sprite Packer). Each XMLPackedSheet needs a base Image which contains the packed sprites and a XML-File for it's description (Position, Name, etc).

Usage[edit]

Create a new Sheet:

XMLPackedSheet sheet = new XMLPackedSheet("res/sheet.png", "res/sheet.xml");

Get a Sprite:

Image image = sheet.getImage("someImage");

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.

See Also[edit]