Hazel
Hazel copied to clipboard
Implemented Texture UVs Offset for SpriteComponent
It follows the same implementation than texture tilling of #403
It also includes an extension of the scene serializer to read glm::vec2 (required for doing the serialization of the UVOffset variable, but I can change it to 2 separated floats)
Describe the issue
It's no issue actually, it's just a feature consisting on adding a vec2 acting as an X & Y offset for the UVs of a texture in the Texture shader, as it can be common in for sprites.
PR impact
List of related issues/PRs this will solve:
Impact | Issue/PR |
---|---|
Issues this solves | None |
Other PRs this solves | None |
Additional context
I tested it on Windows 10 (my PC), I just loaded a square with a texture and works perfectly in my machine (including the save & load)
Overall, a good suggestion. In the future we'd probably want some UI to set offsets (so we could actually see the texture and maybe set a bounding box around the portion we want to use), however this is good for now. Definitely no additional vertex attributes for this though!
Please update/fix any merge conflicts and I'll merge it in. 🙂