kyptov Posted February 19, 2015 Share Posted February 19, 2015 I have one sprite with shotscurtov.hol.es/pixiloader/blasts.png I need to make array from texture and use them later. To make sprite I used TexturePacker and some frames was rotated. So I have the next code from json file exported by TexturePacker var frames = [{"filename": "11_protoss","frame": {"x":403,"y":387,"width":58,"height":37},"rotated": true},{"filename": "11_terran","frame": {"x":433,"y":377,"width":42,"height":6},"rotated": true}]To rotate texture I used DOC and generateTexture() texture = new PIXI.Texture(baseTexture, frames[i].frame);if (frames[i].rotated) { doc = new PIXI.DisplayObjectContainer(); sprite = new PIXI.Sprite(texture); sprite.rotation = - Math.PI / 2; doc.addChild(sprite); texture = doc.generateTexture();}Everything fine in Chrome, but all rotated in FF without transparency.http://curtov.hol.es/pixiloader/ Quote Link to comment Share on other sites More sharing options...
Neso Posted February 19, 2015 Share Posted February 19, 2015 Have you considered disabling rotation in the Texture packer. In order to save time and keep the framerate high in runtime. Otherwise, really awesome graphics. Quote Link to comment Share on other sites More sharing options...
xerver Posted February 19, 2015 Share Posted February 19, 2015 TexturePacker rotation is not supported in v2 of pixijs, so you should turn it off. In v3, we support it natively and you wont even notice that frames are rotated. Quote Link to comment Share on other sites More sharing options...
kyptov Posted February 20, 2015 Author Share Posted February 20, 2015 I resolved it by adding {transparent: true} to renderer. Waiting for v3... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.