function button_draw()
for i,v in ipairs(button) do
if v.mouseover == false then
love.graphics.setColor(0,0,0)
end
if v.mouseover == true then
love.graphics.setColor(0,255,255)
end
love.graphics.setFont(medium)
love.graphics.print(v.text,v.x,v.y)
end
end
I think those are the parts I'd need to edit to make it work. Any ideas?
you don't show where you set the buttons' mouseover field though... but in there, just do a love.audio.play(sound)... or a sound:play().
Unless you set it up as looping, it should only play once.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
function button_check()
for i,v in ipairs(button) do
if mousex > v.x and
mousex < v.x + medium:getWidth(v.text) and
mousey > v.y and
mousey < v.y + medium:getHeight() then
v.mouseover = true
else
v.mouseover = false
end
end
end
Thats the mouseover field. I tried to just do sound:play() but while I'm hovering over the button it just loops the sound until I take my mouse off of it.
function button_check()
for i,v in ipairs(button) do
if mousex > v.x and
mousex < v.x + medium:getWidth(v.text) and
mousey > v.y and
mousey < v.y + medium:getHeight() then
v.mouseover = true
else
v.mouseover = false
end
end
end
Thats the mouseover field. I tried to just do sound:play() but while I'm hovering over the button it just loops the sound until I take my mouse off of it.