例えばデータ形式をStarling
に設定したときの話。
C:\Program Files\Adobe\Adobe Flash CC\Common\Configuration\Sprite Sheet Plugins
にある Starling.plugin.jsfl
の frameExport
メソッドを書き換える。
function frameExport(frame) {
var frameId = frame.id;
if (frame.symbol != null && frame.frameSource instanceof SymbolItem) {
frameId = frame.frameSource.name;
var frameNumber = ('0000' + frame.frameNumber).slice(-4);
frameId = frameId + frameNumber;
}
var s = '\t<SubTexture name="' + frameId + '" ... ';
// 以下省略
}
ライブラリ項目名(jsfl.Item.name
)が重複してもスプライトシートのサブテクスチャ名はjsfl.Item.name
が出力される。
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="sprite-sheet.png">
<!-- Created with Adobe Flash Professional version 13.1.0.226 -->
<!-- http://www.adobe.com/products/flash.html -->
<SubTexture name="Bar0000" x="2" y="198" width="35" height="35" pivotX="-32" pivotY="-4"/>
<SubTexture name="Bar0001" x="2" y="235" width="35" height="35"/>
<SubTexture name="Bar0002" x="2" y="272" width="35" height="35"/>
<SubTexture name="Foo/Bar0000" x="2" y="2" width="47" height="47"/>
<SubTexture name="Foo/Bar0001" x="2" y="51" width="47" height="47"/>
<SubTexture name="Foo/Bar0002" x="2" y="100" width="47" height="47"/>
<SubTexture name="Foo/Bar0003" x="2" y="149" width="47" height="47"/>
</TextureAtlas>