Difference between revisions of "XML Packed SpriteSheet"
From Slick2D Wiki
(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...") |
|||
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]] |
Revision as of 14:48, 8 August 2013
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
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.