animeloha.blogg.se

Photoshop to texturepacker
Photoshop to texturepacker








photoshop to texturepacker

Private function file_selectHandler(event:Event):void This._selectedAtlasFile.browseForOpen("Select Sparrow/Starling Texture Atlas XML", ) This._selectedAtlasFile.addEventListener(Event.CANCEL, file_cancelHandler) This._selectedAtlasFile.addEventListener(Event.SELECT, file_selectHandler) Private function chooseFileButton_clickHandler(event:MouseEvent):void Private function nativeDragDropHandler(event:NativeDragEvent):void If(!(ClipboardFormats.FILE_LIST_FORMAT))Ĭonst files:Array = (ClipboardFormats.FILE_LIST_FORMAT) as Array Private function nativeDragEnterHandler(event:NativeDragEvent):void Var yOffset:Number = parseFloat() - charFrameHeight Var charFrameHeight:Number = parseFloat(SubTexture.attribute("frameHeight").toString()) Var charFrameWidth:Number = parseFloat(SubTexture.attribute("frameWidth").toString()) Var charHeight:Number = parseFloat(SubTexture.attribute("height").toString()) Var charWidth:Number = parseFloat(SubTexture.attribute("width").toString()) Var charName:String = SubTexture.attribute("name").toString() Private function convert(atlasXML:XML, atlasBitmapData:BitmapData):XMLĬonst subTextures:XMLList = atlasXML.SubTexture įor each(var SubTexture:XML in subTextures) Since some special characters can't be used in file names, see the LONG_NAME_TO_CODE constant for conversion. The sub-textures need to be named after the character that they represent (so a.png to display lowercase a, b.png for b, etc.). It's been a while since I used it, but I don't think there have been major changes to either format since then, so it should work. I wrote a little Flex app to convert a Starling texture atlas exported from Texture Packer into the proper format for a bitmap font. I customized a font in Photoshop and exported PNGs, but I wanted to end up with a bitmap font. I had a similar requirement for one of my old games.










Photoshop to texturepacker