melonjs / melonJS

a fresh, modern & lightweight HTML5 game engine
https://melonjs.org
MIT License
5.77k stars 641 forks source link

The result of the flip object vibrates #1214

Open amrimelongaming opened 5 months ago

amrimelongaming commented 5 months ago

Describe the bug

The result of the flip object vibrates

To Reproduce

Execute the flip function and see the result when the flip object vibrates.

Expected behavior

The first image of the animation (the png sequence) as the main pivot reference so the other sequence will follow the first image pivot and the result there's no issue when flip the animation.

Screenshots

Screenshot 2024-01-23 095650

Live Example

Device (please complete the following information):

Additional context

We've followed your suggestion to disabled trimming, and it works. but the problem is that if this applies to all image assets, it will take up space on the texture packer page which is limited to only 16 pages so it will impact on how many asset images that are included in the game level. Ideally, in my opinion, the trimming process helps to add assets to the texture packer page so that on 1 level we will have more assets. Therefore, if possible, the texture packer will still do trimming, but the pivot in the melon editor will not change but will remain in the middle. I tried using unity to put animation using trimming and flip animation like the one use in melon editor and it work perfectly fine, after I check it looks like the unity using the first image of the animation (the png sequence) as the main pivot reference so the other sequence will follow the first image pivot and the result there's no issue when flip the animation. Can we apply their features to our melon editor? So we can trim all the assets.