cursors
This commit is contained in:
parent
101ba11709
commit
c4d1846765
5 changed files with 28 additions and 1 deletions
|
@ -106,9 +106,29 @@ end
|
|||
|
||||
function self.update(dt)
|
||||
bench.startBenchmark('update_buttons')
|
||||
for _,btn in ipairs(headerbuttons) do
|
||||
|
||||
local x = 19
|
||||
local y = 3
|
||||
local anyhover = false
|
||||
for b,btn in ipairs(headerbuttons) do
|
||||
btn.openanim = btn.openanim + dt * 6
|
||||
local size = (love.graphics.getWidth()/640)
|
||||
local hovered = mouseOverBox(x * size, y * size, sprites['header/buttonbg']:getWidth() * size, sprites['header/buttonbg']:getHeight() * size)
|
||||
|
||||
if btn.open and hovered then
|
||||
love.mouse.setCursor(cursors.hover)
|
||||
anyhover = true
|
||||
end
|
||||
|
||||
local incr = 69 -- its like button positions but forcefully shoved into a recursive function :D
|
||||
if b == 2 then incr = 57 end
|
||||
if b >= 3 then incr = 73 end
|
||||
x = x + incr
|
||||
end
|
||||
if not anyhover then
|
||||
love.mouse.setCursor(cursors.default)
|
||||
end
|
||||
|
||||
bench.stopBenchmark('update_buttons')
|
||||
|
||||
bench.startBenchmark('update_food')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue