Jump to content

How can i control TexturePack with rotation


GBear
 Share

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..

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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

 

 

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...