about summary refs log tree commit diff stats
path: root/button.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-10-16 22:53:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-10-16 22:57:46 -0700
commit4b3f3595266729a16a2a5bdb2a480576d332c14c (patch)
tree8776a614abf1d0621284c2fb4808bcf59d1f2ed8 /button.lua
parentea4a8379fe577207509719af41491190035fc8fa (diff)
downloadlines.love-4b3f3595266729a16a2a5bdb2a480576d332c14c.tar.gz
clearer API for drawing a button
Make it more obvious that the color passed in is just for the background.
The icon will do the rest.
r/g/b keys are more consistent with App.color().
Diffstat (limited to 'button.lua')
-rw-r--r--button.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/button.lua b/button.lua
index 7549169..55e4b1e 100644
--- a/button.lua
+++ b/button.lua
@@ -12,7 +12,7 @@ function button(State, name, params)
   if State.button_handlers == nil then
     State.button_handlers = {}
   end
-  love.graphics.setColor(params.color[1], params.color[2], params.color[3])
+  love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b)
   love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
   if params.icon then params.icon(params) end
   table.insert(State.button_handlers, params)