diff options
| author | Chris B <1029chris@gmail.com> | 2015-12-30 17:25:00 -0800 |
|---|---|---|
| committer | Chris B <1029chris@gmail.com> | 2015-12-30 17:25:00 -0800 |
| commit | c7367067b637fff0dea66ef16a27b7922c9c0e44 (patch) | |
| tree | 2e0e7787ce767c6afd3313f1c642df2b56b47155 /main.lua | |
| parent | 8ac6e3c2c10c623628c3dd67f69edaabf49952e1 (diff) | |
Adding interface
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 50 |
1 files changed, 41 insertions, 9 deletions
@@ -1,19 +1,51 @@ function love.load() - system = {} - system.width = love.graphics.getWidth() - system.height = love.graphics.getHeight() - system.mouse = {} - system.mouse.x = love.mouse.getX - system.mouse.y = love.mouse.getY + sys = {} + sys.width = love.graphics.getWidth() + sys.height = love.graphics.getHeight() + sys.mouse = {} + sys.mouse.x = love.mouse.getX + sys.mouse.y = love.mouse.getY love.graphics.setBackgroundColor(0, 128, 128) + panel = {} + panel.thick = 35 + panel.x = 0 + panel.y = sys.height-panel.thick + panel.width = sys.width + panel.height = panel.thick + panel.s = {} + panel.s.x = panel.x + 5 + panel.s.y = panel.y + 5 + panel.s.width = 65 + panel.s.height = 25 + panel.s.activate = false + love.graphics.setNewFont("fonts/pressstart.ttf", 12) + test = false end function love.update(dt) - system.mouse.x = love.mouse.getX - system.mouse.y = love.mouse.getY + sys.mouse.x = love.mouse.getX() + sys.mouse.y = love.mouse.getY() if love.keyboard.isDown("escape") == true then love.event.quit() end + if love.mouse.isDown(1) then + if sys.mouse.x >= panel.s.x and sys.mouse.x <= panel.s.x+panel.s.width then + if sys.mouse.y >= panel.s.y and sys.mouse.y <= panel.s.y+panel.s.height then + test = true + end + end + end end function love.draw() - love.graphics.rectangle("fill", 0, system.height-26, system.width, 26) + love.graphics.setColor(192, 192, 192) + love.graphics.rectangle("fill", panel.x, panel.y, panel.width, panel.height) + love.graphics.setColor(220, 220, 220) + love.graphics.setLineWidth(3) + love.graphics.line(panel.x, panel.y, panel.width, panel.y) + love.graphics.setColor(165, 165, 165) + love.graphics.rectangle("line", panel.s.x, panel.s.y, panel.s.width, panel.s.height) + love.graphics.setColor(70,70,70) + love.graphics.print("START", panel.s.x+4, panel.s.y+9) + if test == true then + love.graphics.print("IT WORKS") + end end |
