Phaser should create the offsets of the bodies by thinking “hey, the pivot point of the Texture is 0.5 of 240px, so the offset of the body is 0.5 of 240px”. Or i’ll try to change Phaser code source. So now i have to code a solution to do a correction of the offsets at each frame, because i have many ships and it would be too long to rework all the vertexes created by PhysicsEditor to check those which make the body a pixel righter or lefter. This is why when i create a body with one vertex placed at the top of the 240x240px frame (like on my picture above) then the texture and body is placed at the same place, but like i said it’s not a solution, it only shows that Phaser need improvements at this subject. Each vertex point a bit placed too righly, leftly, uply or downly with PhysicsEditor, make the body offset completely different, causing texture jittering. It shouldn’t work like that, Phaser should place the body according to only one pivot point and it should be the one generated by Texture Packer. Each time that i change the body then the texture reposition itself according to the body, but Phaser is generating the body’s offsets based on the height /width of the body shape and not based on the height/width of the texture. Ok so the offsets of the body is constantly changing because it doesn’t respect I tried to change the body offset according to the size and center of my texture (240x240) and the jittering stopped, but look at the result, the body doesn’t respect the center point from 240x240 based on the texture frame: = 120 The body shape should refer itself to the displayWidth and displayHeight of the texture frame in order to create it’s pivot point so the texture and the body are at the same place, but it seems like it doesn’t work like that, so it’s the texture that is trying to replace itself at the same point that the body… How can i avoid that ? The framework doesn’t work well with PhysicsEditor and polygon because it shouldn’t have this behavior. Why the center offset is not always the same ? I tried to change it but it continues. It seems like it cause jittering because the center offset of the body is changing each time i change the shape, and the texture is trying to replace itself according to the shapes.
0 Comments
Leave a Reply. |