GBear Posted December 12, 2015 Author Share Posted December 12, 2015 hi. ivan. this looks great.. but here looks one problem i changed y coordinate to 0 from 50 and then i can look image that has wrong position http://jsfiddle.net/s7bj8y3x/12/ this is changed jsfiddle it seems only third is wrong thx Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 12, 2015 Share Posted December 12, 2015 There are offsets for second and third, look at the atlas. For third image, 20 pixels were trimmed from above.offset: 0, 2offset: 0, 20 Quote Link to comment Share on other sites More sharing options...
GBear Posted December 14, 2015 Author Share Posted December 14, 2015 hi. anwser is late.. sorry..hmm. yes but....it's wrong... 20 pixels were trimmed from above.. you right. but it's looks not 20 pixel.. this is right image when all trimmed image drawn second and third don't have empty pixel..but in this case it's not...! thx.. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 14, 2015 Share Posted December 14, 2015 Ok, now I understand how this needs to be trimmed, i'll fix it Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 25, 2016 Share Posted January 25, 2016 Trim and rotation are working! Build latest pixi from github dev branch. This thing will work: var atlas = assets.animation.spineAtlas; var textures = {}; for (var i=0; i<atlas.regions.length; i++) { var region = atlas.regions; var baseTexture = region.page.rendererObject; var frame = new PIXI.Rectangle(region.x, region.y, region.width, region.height); var crop = frame.clone(); var trim = new PIXI.Rectangle(region.offsetX, region.originalHeight - region.height - region.offsetY, region.originalWidth, region.originalHeight); textures[region.name] = new PIXI.Texture(baseTexture, frame, crop, trim, region.rotate?6:0)); } You can mark that as solution on this topic. Quote Link to comment Share on other sites More sharing options...
GBear Posted January 25, 2016 Author Share Posted January 25, 2016 thx ivan.. always.. ^^/ Awesome.. 3.0.9 has your rotating system? maybe it is D4... Is it good on canvas and webgl with pixi spine atlas when i set region.rotate to 6? because i'm using own system to draw normal image if it is right i will update to new viersion. i;m using 3.0.8 now.. ps. 3.0.9 is a little bit slow than 3.0.8. i don't know correctly reason.. but i tested with my game and example that only draw a lot of spine on scree Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 25, 2016 Share Posted January 25, 2016 https://github.com/ivanpopelyshev/examples/blob/master/_site/js/pixi.js - I compiled it for you. Rotations are in latest commit, there is no official build for it yet. UPD. I'll change the way how frame/crop/trim work soon. I'll notify you about it. Quote Link to comment Share on other sites More sharing options...
GBear Posted January 25, 2016 Author Share Posted January 25, 2016 @ivan.popelyshev i see. thx.... ps> do you have plan to update pixi.spine? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 25, 2016 Share Posted January 25, 2016 Yeah, I'll update pixi-spine at the same time, and you wont have to write loading code for an atlas anymore. It will just work 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.