HeladoDeBrownie / Nexus

creative sandbox game in early development
MIT License
3 stars 1 forks source link

consider using stencils and offsets in place of canvases for ui #103

Closed HeladoDeBrownie closed 3 years ago

HeladoDeBrownie commented 3 years ago

using a canvas for each widget was a somewhat more complex choice than i realized at the time. it's worth seeing if the same degree of abstraction can be provided using stencils and transform offsets. this might also cause the game to use less resources

HeladoDeBrownie commented 3 years ago

https://love2d.org/wiki/love.graphics.stencil

HeladoDeBrownie commented 3 years ago

the main downside of this will probably be that it leaks abstraction if a widget needs to set transforms itself. should probably do our best to only use relative transforms within widgets

HeladoDeBrownie commented 3 years ago

this would be mutually exclusive with making it so that widgets only redraw themselves when required, instead of every frame

HeladoDeBrownie commented 3 years ago

considering the downsides, i think it's better to drop this one