com.threerings.media.tile.tools.xml
Class ObjectTileSetRuleSet
java.lang.Object
org.apache.commons.digester.RuleSetBase
com.threerings.media.tile.tools.xml.TileSetRuleSet
com.threerings.media.tile.tools.xml.SwissArmyTileSetRuleSet
com.threerings.media.tile.tools.xml.ObjectTileSetRuleSet
- All Implemented Interfaces:
- ValidatedSetNextRule.Validator, org.apache.commons.digester.RuleSet
public class ObjectTileSetRuleSet
- extends SwissArmyTileSetRuleSet
Parses ObjectTileSet instances from a tileset description. An
object tileset description looks like so:
<tileset name="Sample Object Tileset">
<imagePath>path/to/image.png</imagePath>
<!-- the widths (per row) of each tile in pixels -->
<widths>265</widths>
<!-- the heights (per row) of each tile in pixels -->
<heights>224</heights>
<!-- the number of tiles in each row -->
<tileCounts>4</tileCounts>
<!-- the offset in pixels to the upper left tile -->
<offsetPos>0, 0</offsetPos>
<!-- the gap between tiles in pixels -->
<gapSize>0, 0</gapSize>
<!-- the widths (in unit tile count) of the objects -->
<objectWidths>4, 3, 4, 3</objectWidths>
<!-- the heights (in unit tile count) of the objects -->
<objectHeights>3, 4, 3, 4</objectHeights>
<!-- the default render priorities for these object tiles -->
<priorities>0, 0, -1, 0</priorities>
<!-- the constraints for these object tiles -->
<constraints>ATTACH_N, ATTACH_E, ATTACH_S, ATTACH_W</constraints>
</tileset>
| Fields inherited from class org.apache.commons.digester.RuleSetBase |
namespaceURI |
|
Method Summary |
void |
addRuleInstances(org.apache.commons.digester.Digester digester)
Adds the necessary rules to the digester to parse our tilesets. |
protected Class<? extends TileSet> |
getTileSetClass()
A tileset rule set will create tilesets of a particular class,
which must be provided by the derived class via this method. |
| Methods inherited from class org.apache.commons.digester.RuleSetBase |
getNamespaceURI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectTileSetRuleSet
public ObjectTileSetRuleSet()
addRuleInstances
public void addRuleInstances(org.apache.commons.digester.Digester digester)
- Description copied from class:
TileSetRuleSet
- Adds the necessary rules to the digester to parse our tilesets.
Derived classes should override this method, being sure to call the
superclass method and then adding their own rule instances (which
should register themselves relative to the
_prefix
member).
- Specified by:
addRuleInstances in interface org.apache.commons.digester.RuleSet- Overrides:
addRuleInstances in class SwissArmyTileSetRuleSet
getTileSetClass
protected Class<? extends TileSet> getTileSetClass()
- Description copied from class:
TileSetRuleSet
- A tileset rule set will create tilesets of a particular class,
which must be provided by the derived class via this method.
- Overrides:
getTileSetClass in class SwissArmyTileSetRuleSet