Code: Select all
function love.load()
text = "DO NOT PUSH"
screen_width = 1280
screen_height = 800
love.graphics.setMode(screen_width, screen_height)
love.graphics.setBackgroundColor(255, 255, 255)
rect = {
x = 400,
y = 204,
width = 200,
height = 200,
}
end
function love.draw()
love.graphics.setColor(255, 0, 0)
love.graphics.rectangle("fill", rect.x, rect.y, rect.width, rect.height)
love.graphics.setColor(0, 0, 0)
love.graphics.print(text, 500, 600)
end
function love.mousepressed(x, y, button)
if button == "l"
and x > rect.x and x < rect.x + rect.width
and y > rect.y and y < rect.y + rect.height
then
text = "*Ahem* Do NOT push"
end
end
Thanks
Qcode