Voobus Posted September 4, 2015 Share Posted September 4, 2015 Hey folks, again... I'm having an issue with my crop not applying to a texture. I was able to apply a frame just fine, but when I apply the crop, either by passing it in as a third parameter, or by using `texture.crop = ___`, it's not applied/ doesn't do anything. let frame = new Pixi.Rectangle(clip.x, clip.y, clip.width, clip.height);let crop = new Pixi.Rectangle(32, 32, 32, 32);let texture = new Pixi.Texture(new Pixi.BaseTexture(img), frame, crop);clip is an object that contains x,y,width,height; img is an image object. Any idea what could be happening? When I output the texture's crop in the console, I get the frame's dimensions. Quote Link to comment Share on other sites More sharing options...
coolblue Posted September 8, 2015 Share Posted September 8, 2015 Hi, there's a comment in the code that suggests crop might be in normalised uv coordinates so, maybe you have to have _uvs set true and maybe the domain for the crop coordinates is [[0, 0], [1,1]] based on the top left of the frame? Also, there seems to be some confusion in the code about trim and crop... Anyway, trim needs to be truthy or crop is set to frame. 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.