Sign in to follow this  
GBear

How can i control TexturePack with rotation

Recommended Posts

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

post-10357-0-50487900-1450053774.png

 

 

second and third don't have empty pixel..

but in this case it's not...!

post-10357-0-62449900-1450053932.png

 

thx..

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.