StudioMaker Posted January 3, 2020 Share Posted January 3, 2020 When i trim my spritesheet then the sprite gets kinda wobbly or something without trim vs with trim on https://gyazo.com/f9d1f6cda13325044c35d53d188cc57b var i = PIXI.Texture.from(t.frames.index[t.i]) , o = new PIXI.Texture(i,new PIXI.Rectangle(i.frame.x,i.frame.y,i.frame.width,i.frame.height)) I'm guessing it is because each frame has a different width and height value as its trimmed, although not entirely sure what the best way to fix this is. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 4, 2020 Share Posted January 4, 2020 (edited) Whats the device, what is the size of an atlas, and which format for spritesheet do you use? It can be 1. Problem with precision on particular device - PixiJS uses "highp" when its possible but not always. In that case atlas size has to be 4096 or so. One pixel shift maximum. 2. wrong parser of format, wrong "trim". 3. something with both with trim and resolution you set for a spritesheet (wrong division by @2, @3 or something like that) I'm going to sleep, if you don't want to wait for tomorrow, look at following places, you can place breakpoints there and figure out whats going on for ONE particular frame that you select: https://github.com/pixijs/pixi.js/blob/dev/packages/core/src/textures/Texture.jshttps://github.com/pixijs/pixi.js/blob/dev/packages/spritesheet/src/Spritesheet.js#L196 https://github.com/pixijs/pixi.js/blob/dev/packages/sprite/src/Sprite.js#L261 Edited January 4, 2020 by ivan.popelyshev 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.