Embedding texturePackerDate

15 views
Skip to first unread message

Matt

unread,
Jun 28, 2015, 9:16:01 AM6/28/15
to haxef...@googlegroups.com
  I've been trying to embed textureSheet but it seems that it doesnt work. So i went into the code of util.loaders.TexturePackerData.hx and modified the code to accept bitmapData insted of a string. Then i hit another wall when i compiled, error shows in FlxSprite class line 529 that is

cachedGraphics.data = cast Data;




Invalid field access
Called from flixel.FlxSprite::loadGraphicFromTexture line 529


Seems that he cant cast  the Data:Dynamic into the cached grapics. Is there anything i can do to make it cast ?

Also here is the code im using for texturePackerData




@:bitmap("assets/images/mainMenu/mainMenuAtlas.png") class MenuAtlas extends BitmapData { }


private var spriteAtlas:TexturePackerData;


spriteAtlas
= new TexturePackerData("assets/data/mainMenuData.json", MenuAtlas);  


bg
.loadGraphicFromTexture(spriteAtlas, false, "bg.png"); //  <--- load bitamp data from embeded TexturePackerData



Reply all
Reply to author
Forward
0 new messages