17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
920 stars 63 forks source link

Improve or remove NineSlice #210

Closed 17cupsofcoffee closed 3 years ago

17cupsofcoffee commented 3 years ago

Summary: NineSlice has a lot of issues:

I think it either needs improving, or deprecating.

Why is this needed? I'm currently reimplementing the same functionality as NineSlice in a game, because Tetra's version isn't good enough.

17cupsofcoffee commented 3 years ago

Fixed on the 0.6 branch. I have opted to move to a similar API to Raylib, with NineSlice just being a config object rather than a wrapper around a specific texture. This is nice because it allows the same config to be used for multiple panels without holding onto any state. The config is also pretty lightweight (8 f32s in total) so you could probably get away with defining it inline in draw, if you wanted to.