wasabi2d icon indicating copy to clipboard operation
wasabi2d copied to clipboard

Nine-patch primitive

Open lordmauve opened this issue 5 years ago • 0 comments

A very useful primitive in games and UIs is a "nine-patch", which is a rectangle styled with a non-repeating texture.

See for example:

  • https://github.com/libgdx/libgdx/wiki/Ninepatches
  • https://github.com/adamlwgriffiths/Pyglet/blob/master/experimental/ninepatch.py

The vertex/UV creation could be implemented entirely in a geometry shader, but this would require a rewrite of the Transformable class to pass pos/angle/scale as attributes rather than building a matrix. The planned ability to group primitives would also have a bearing.

Therefore the simplest way is to stick with the existing CPU-side transformations and optimise later.

lordmauve avatar Oct 08 '19 17:10 lordmauve