split color functions

This commit is contained in:
mango 2025-09-05 11:55:39 -07:00
commit d2f7af607a
2 changed files with 15 additions and 15 deletions

View file

@ -28,11 +28,11 @@ end
function Button:draw() function Button:draw()
if self.press then if self.press then
self.c = {151/255, 109/255, 209/255}
else
self.c = {100/255, 100/255, 100/255}
end
love.graphics.setColor(self.c) love.graphics.setColor(self.c)
else
love.graphics.setColor(100/255, 100/255, 100/255)
end
love.graphics.circle("fill", self.x + self.r, self.y + self.r, self.r+1) love.graphics.circle("fill", self.x + self.r, self.y + self.r, self.r+1)
love.graphics.setColor(1,1,1) love.graphics.setColor(1,1,1)
love.graphics.circle("line", self.x + self.r, self.y+self.r, self.r+1) love.graphics.circle("line", self.x + self.r, self.y+self.r, self.r+1)

View file

@ -5,21 +5,21 @@ function love.load()
local Button = require "button" local Button = require "button"
--movement keys --movement keys
movement = { movement = {
Button(25, 40, 29, "dpleft"), Button(25, 40, 29, "dpleft", {255/255, 179/255, 102/255}),
Button(90, 40, 29, "dpdown"), Button(90, 40, 29, "dpdown", {255/255, 179/255, 102/255}),
Button(147, 71, 29, "dpright"), Button(147, 71, 29, "dpright", {255/255, 179/255, 102/255}),
Button(168, 180, 36, "dpup"), Button(168, 180, 36, "dpup", {255/255, 179/255, 102/255}),
} }
--attack keys, add {x,x,x} value to change color of button --attack keys, add {x,x,x} value to change color of button
attack = { attack = {
Button(207, 43, 29, "x"), Button(207, 43, 29, "x", {150/255, 109/255, 209/255}),
Button(265, 17, 29, "y"), Button(265, 17, 29, "y", {150/255, 109/255, 209/255}),
Button(330, 22, 29, "rightshoulder"), Button(330, 22, 29, "rightshoulder", {150/255, 109/255, 209/255}),
Button(395, 38, 29, "leftshoulder"), Button(395, 38, 29, "leftshoulder", {150/255, 109/255, 209/255}),
Button(202, 110, 29, "a"), Button(202, 110, 29, "a", {150/255, 109/255, 209/255}),
Button(263, 86, 29, "b"), Button(263, 86, 29, "b", {150/255, 109/255, 209/255}),
Button(330, 88, 29, "triggerright"), Button(330, 88, 29, "triggerright", {150/255, 109/255, 209/255}),
Button(394, 105, 29, "triggerleft"), Button(394, 105, 29, "triggerleft", {150/255, 109/255, 209/255}),
} }
end end