Compare commits
No commits in common. "594e47ffd13d732cbd74f3921c5b02cf211b0d8f" and "cbf45ae44f25ce2a1c6e0029e6abfe179f25d324" have entirely different histories.
594e47ffd1
...
cbf45ae44f
4 changed files with 11 additions and 40 deletions
|
@ -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,7 +33,6 @@ 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
|
||||
|
||||
|
|
12
conf.lua
12
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
|
BIN
icon.png
BIN
icon.png
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 9.9 KiB |
30
main.lua
30
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue