Diddy: Get handles from XML

Monkey Forums/User Modules/Diddy: Get handles from XML

Raz(Posted 2014) [#1]
I'm messing around with Diddy and loading images from an XML file.

Am I right in thinking it's not possible to load image handles directly from the XML file? I'm aware it has a midhandle:Bool argument, but not specifically a XHandle and YHandle argument.

Ta!
-Chris


therevills(Posted 2014) [#2]
I take it you are talking about loading an atlas from XML? If so, the only XML atlas file Diddy support is Sparrow and as far as I know that does not give you the option to state the handle...

If not - what system are you referring to?


Raz(Posted 2014) [#3]
Sorry, yes therevills loading an atlas, I was using sparrow (copied the example sprites.xml and edited it for my needs).

No worries, just seeing if I had missed something


therevills(Posted 2014) [#4]
It sounds like a good enhancement what format did you use? We could add it unofficially so to speak to the Sparrow format.


Raz(Posted 2014) [#5]
I haven't used any yet, but I was thinking something like

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with TexturePacker http://texturepacker.com-->
<!--  -->
<TextureAtlas imagePath="test/test.png">
    <SubTexture name="column" x="0" y="0" width="16" height="48" xhandle="8" yhandle="32"/>
    <SubTexture name="sprite" x="32" y="24" width="16" height="48" xhandle="8" yhandle="16"/>
    <SubTexture name="grass" x="32" y="0" width="16" height="16 xhandle="0" yhandle="0""/>
</TextureAtlas>

It'd be great if a tool could handle... handles, I'm just looking at texture packer to see what it can do!