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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.