https://futureofcoding.org/ logo
#devlog-together
Title
# devlog-together
k

Kartik Agaram

12/17/2023, 6:33 PM
One nice reusable abstraction my LÖVE apps have all converged on is an immediate-mode button primitive. I draw all my buttons each frame along with all the callbacks they need, and a couple of framework-y lines of code in the mouse-press callback is all it takes to get them working. Last night I realized (while poking inside https://love2d.org/forums/viewtopic.php?p=236661#p236661) that my hacky sliders in Lua Carousel's settings admit a similar abstraction (even better than the one there). The only additional complexity is it needs a couple more lines in the
update
callback that continually refresh the backing value as you drag the slider.