You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.
Nathaniel Nelson edited this page Oct 17, 2013
·
1 revision
You can encode the content of your game in XML files and use JavaLib to automatically load the content.
SpriteSheet XML
The format for encoding your game's SpriteSheet is as follows.
All information is wrapped in an XML element:
<SpriteSheet>
...
</SpriteSheet>
The SpriteSheet texture's internal file path must be encoded as a child anywhere within the SpriteSheet element. For example:
<texture>data/spritesheet.png</texture>
The SpriteSheet's source rectangles are each encoded in elements with the name "rect", a key attribute, and their x, y, width and height within the element, as follows:
<rect key="Player">0, 0, 8, 8</rect>
Initialize your game's SpriteSheet using the static fromXML() method, which takes only a FileHandle parameter, as follows: