love2d
function love.load ()
_x=200
_y=200
font = love.graphics.newFont( 12 )
text = love.graphics.newText( font, "NOT BUTTON" )
end
function love.update (dt)
end
function love.draw ()
love.graphics.setColor(255, 255, 255)
love.graphics.rectangle('fill', _x,_y, 100, 50)
love.graphics.draw( text, 10,10)
end
function love.mousepressed( x, y, button, istouch )
if x < _x then text:set ("NOT BUTTON")
elseif x > _x+100 then text:set ("NOT BUTTON")
elseif y < _y then text:set ("NOT BUTTON")
elseif y> _y+50 then text:set ("NOT BUTTON")
else
text:set ("!!! BUTTON !!!")
end
end
Public Last updated: 2017-11-01 12:09:07 PM