Jump to content

Upgrading to pixi 1.6.0


hubert
 Share

Recommended Posts

Hi i have upgraded to pixi version 1.6.0 from 1.5.1.

 

Previously I had a hug container that i have been cutting into smeller chunks with PIXI.renderTexture(5000, 5000) and set frame methid. Previously set frame cut only a part of the texture so i could use it as a sprite. but now it is shrinking the whole texture to the size that i pass in the setFrame method.

 

ANYBODY KNOWS HOW TO TRIM A RENDERED TEXTURE IN PIXI 1.6.0???

 

Content of the entity container is generated dynamically so I don't know what to do?!

var finalEntityTexture0 = new PIXI.RenderTexture(dim * 30, dim * 30);                    finalEntityTexture0.render(entityContainer);                    finalEntityTexture0.setFrame({x: 0, y: 0, width: dim * 10, height: dim * 10});                                                            var finalEntity0 = new PIXI.Sprite(finalEntityTexture0);                    finalEntity0.position.x = 0;                    finalEntity0.position.y = 0;

This is what i have in PIXI 1.5.0

 

vursonX.jpg

 

 

And this is pixi 1.6.0

 

LR7crSX.jpg

 

 

As you can see the whole container is repeated and shrunk to the size that i have passed in set.Frame Method.

 

 

Any idea to cut and copy part of render texture and add use it as a texture for a sprite?

 

Link to comment
Share on other sites

FORGET IT!

 

YOU CAN CROP THE IMAGE AND IT IS DONE!

var finalEntityTexture0 = new PIXI.RenderTexture(dim * 30, dim * 30);                    finalEntityTexture0.crop = new PIXI.Rectangle(0, 0, dim * 10, dim * 10);                    finalEntityTexture0.render(entityContainer);                    finalEntityTexture0.setFrame({x: 0, y: 0, width: dim * 10, height: dim * 10});
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...