Nazariglez / notan

Cross-platform multimedia layer
https://nazariglez.github.io/notan-web/
Apache License 2.0
802 stars 55 forks source link

Elaborate the nine slicing example. #253

Closed jayphur closed 1 year ago

jayphur commented 1 year ago

I'm excited to see that notan has a nine slicing feature, however examples/draw_nine_slice.rs does not really explain how the feature works. (such as defining where the corner are on the image).

Nazariglez commented 1 year ago

Hello! The corners are calculated automatically by dividing the width and height of the image passed by 3. You can alter those parameters with the methods top|bottom|right|left to define how much of the image you want to use per size.

https://docs.rs/notan/latest/notan/draw/struct.NineSlice.html