diff options
| author | Chris B <1029chris@gmail.com> | 2016-01-19 14:31:42 -0800 |
|---|---|---|
| committer | Chris B <1029chris@gmail.com> | 2016-01-19 14:31:42 -0800 |
| commit | 4cd58938357d90c0aaf89d82ed26eb55691398fc (patch) | |
| tree | 69e748f2d2ddfdd2c53f2138e999b1fcc50dafe7 /main.lua | |
| parent | b94772fccb169d00cca6e478c6924d4bf2b33b6e (diff) | |
worked on start menu
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -18,7 +18,7 @@ function love.load() panel = {} panel.thick = 30 panel.x = 0 - panel.y = sys.height-panel.thick + panel.y = 600-panel.thick panel.width = sys.width panel.height = panel.thick panel.s = {} @@ -48,6 +48,8 @@ function love.load() win[1].miny = 0 start = {} start.cvs = love.graphics.newCanvas(250, 350) + start.o = false + start.p = false end function love.update(dt) sys.mouse.x = love.mouse.getX() @@ -77,6 +79,7 @@ function love.mousepressed(x, y, button) end function love.mousereleased(x, y, button) sys.mouse.p.p = false + start.p = false end function love.draw() if win[1].ex == true and win[1].s == 0 then @@ -84,8 +87,23 @@ function love.draw() drawWindow(1, win[1].x, win[1].y, win[1].w, win[1].h, "Chat") end drawStart() + if sys.mouse.p.p == true and start.p == false and sys.mouse.p.x >= panel.s.x and sys.mouse.p.x <= panel.s.x+panel.s.width then + if sys.mouse.p.y >= panel.s.y and sys.mouse.p.y <= panel.s.y+panel.s.height then + start.p = true + if start.o == true then + start.o = false + elseif start.o == false then + start.o = true + end + end + end + if start.o == true and sys.mouse.p.p == true and sys.mouse.p.x > 255 or sys.mouse.p.y < 220 then + start.o = false + end + if start.o == true then + drawMenu() + end --if test == true then -- love.graphics.print("IT WORKS " .. sys.mouse.p.x, 100, 100) --end - drawMenu() end |
