Antoshidza / NSprites-Foundation

Basic assets for working with NSprites package
MIT License
65 stars 17 forks source link

Rotation Support #2

Closed JeroenoBoy closed 1 year ago

JeroenoBoy commented 1 year ago

For the game I am making, I need sprites to be able to rotate.

Could this feature be added to the library?

Antoshidza commented 1 year ago

Yes, it can be implemented, but it should be a part of Transform2D and have all stuff like parent -> child rotation computations OR foundation should refuse to use 2D and instead use all 3D Unity.Transform components and instead of constructing matrix in shader just pass it in. So I need to think what is a better way.

If you want it right here and now, then you can implement it by yourself. There are 3 possible ways I can imagine of how it can be done. (as a shader reference I will use https://github.com/Antoshidza/NSprites-Foundation/blob/main/Graphics/Regular%20Render/RegularNSprites_Shader.shader)

Antoshidza commented 1 year ago

After a bit thinking I've decide that

What type of game you developing? 2D / 2,5D / 3D ?

JeroenoBoy commented 1 year ago

Hi, the game I'm currently making is 2d. If you want an idea of what I'm trying to make, think reassembly, but way bigger.

JeroenoBoy commented 1 year ago

After some fiddeling around, I've got it to work on my fork https://github.com/JeroenoBoy/Fundering

Antoshidza commented 1 year ago

That's good. I've been on vacation, so now can return to work. I need to complete authoring refactoring, and then merge your changes, because I see that you also find and fix those bugs.

Antoshidza commented 1 year ago

From now this package allows rotations (merged). Thanks for @JeroenoBoy