diff --git a/button.lua b/button.lua index ec586fc..9c7319a 100644 --- a/button.lua +++ b/button.lua @@ -1,16 +1,16 @@ local Object = require "classic" local Button = Object:extend() -function Button:new(x, y, r, b, c) +function Button:new(x, y, r, b) self.x = x self.y = y self.r = r self.b = b - self.c = c or {1, 1, 1} self.press = false end function Button:update(dt) + if self.b == "triggerleft" or self.b == "triggerright" then if fightstick:getGamepadAxis(self.b) == 1 then self.press = true @@ -33,8 +33,7 @@ function Button:draw() else mode = "line" end - love.graphics.setColor(self.c) love.graphics.circle(mode, self.x + self.r, self.y + self.r, self.r) end -return Button +return Button \ No newline at end of file diff --git a/conf.lua b/conf.lua index e261ea0..d436c39 100644 --- a/conf.lua +++ b/conf.lua @@ -1,14 +1,10 @@ -WINDOWSCALE = 1 -WINDOWWIDTH = 373*WINDOWSCALE -WINDOWHEIGHT = 212*WINDOWSCALE -BORDERLESS = true -BLACK = true function love.conf(t) - t.window.width = WINDOWWIDTH - t.window.height = WINDOWHEIGHT - t.window.borderless = BORDERLESS + t.window.width = 373 + t.window.height = 212 + t.window.borderless = true t.window.title = "input display" t.window.icon = "icon.png" t.modules.physics = false + end \ No newline at end of file diff --git a/icon.png b/icon.png index 8215d73..7555bbc 100644 Binary files a/icon.png and b/icon.png differ diff --git a/main.lua b/main.lua index eacaabd..b482d81 100644 --- a/main.lua +++ b/main.lua @@ -1,9 +1,9 @@ function love.load() - joysticks = love.joystick.getJoysticks() fightstick = joysticks[1] require("sdl") + require("invis") local Button = require "button" love.window.setPosition(1440, 960-373) @@ -16,7 +16,7 @@ function love.load() Button(127, 144, 30, "dpup"), } - --attack keys, add {x,x,x} value to change color of button + --attack keys attack = { Button(159, 29, 24, "x"), Button(208, 8, 24, "y"), @@ -29,31 +29,7 @@ function love.load() } end ---switches the borderless window setting, remembering the position -function love.keypressed(key) - if key == "space" then - if BORDERLESS then - BORDERLESS = false - love.window.setMode(WINDOWWIDTH, WINDOWHEIGHT, {borderless=false, x=windowx, y=windowy}) - else - BORDERLESS = true - love.window.setMode(WINDOWWIDTH, WINDOWHEIGHT, {borderless=true, x=windowx, y=windowy}) - end - end - if key == "c" then - if BLACK then - BLACK = false - love.graphics.setBackgroundColor(0,1,0) - else - BLACK = true - love.graphics.setBackgroundColor(0,0,0) - end - end -end - function love.update(dt) - windowx, windowy, _ = love.window.getPosition() - --movement keys for i, v in ipairs(movement) do v:update(dt) @@ -66,7 +42,7 @@ function love.update(dt) end function love.draw() - love.graphics.scale(WINDOWSCALE, WINDOWSCALE) + love.graphics.setBackgroundColor(1, 179/255, 102/255) --movement keys for i, v in ipairs(movement) do @@ -77,4 +53,4 @@ function love.draw() for i, v in ipairs(attack) do v:draw() end -end +end \ No newline at end of file