hubert Posted August 16, 2014 Share Posted August 16, 2014 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 And this is pixi 1.6.0 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? Quote Link to comment Share on other sites More sharing options...
hubert Posted August 16, 2014 Author Share Posted August 16, 2014 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}); 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.