godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.33k stars 21.06k forks source link

sprite rotate problem ! #38400

Closed GuyHanan closed 2 years ago

GuyHanan commented 4 years ago

Godot version: Godot_v3.2.1 OS/device including version:

Issue description: sprite rotate problem: image: image

i get this problem with sprite then i change the rotation degrees and i not found any way to fix this and i not found any answer for this in the internet..

Steps to reproduce: create sprite in the scene and change the rotation degrees to any Positive number then run the game!, Except 0degrees, 90degrees, 180degrees, 360degrees (note: you need run the game to see the problem, its not happen in the editor!)

Minimal reproduction project:

Calinou commented 4 years ago

If you're zooming in the 2D editor or using the viewport stretch mode, this is expected. With the viewport stretch mode, you can't render pixels that are smaller than what the viewport size defines.

You could use the RotSprite algorithm for high-quality pixel art rotation, but it's not implemented in Godot. I don't know if it's feasible in real-time anyway.

If this is a problem for your use case, switch from the viewport stretch mode to the 2d stretch mode in the Project Settings.

Cerno-b commented 2 years ago

I second what @Calinou said: For people who want pixel-precision in their game, this is pretty much the desired behaviour, because you cannot cleanly rotate a sprite while obeying the pixel grid.

If you don't want pixel perfection (I assume you don't), then there is a setting for that as @Calinou described.

Calinou commented 2 years ago

Closing, as this is expected behavior when using the viewport stretch mode.