added custom button colors and borderless toggle
This commit is contained in:
parent
25c8eb5304
commit
40034d2f00
4 changed files with 27 additions and 8 deletions
21
main.lua
21
main.lua
|
@ -3,7 +3,6 @@ function love.load()
|
|||
fightstick = joysticks[1]
|
||||
|
||||
require("sdl")
|
||||
require("invis")
|
||||
local Button = require "button"
|
||||
|
||||
love.window.setPosition(1440, 960-373)
|
||||
|
@ -16,7 +15,7 @@ function love.load()
|
|||
Button(127, 144, 30, "dpup"),
|
||||
}
|
||||
|
||||
--attack keys
|
||||
--attack keys, add {x,x,x} value to change color of button
|
||||
attack = {
|
||||
Button(159, 29, 24, "x"),
|
||||
Button(208, 8, 24, "y"),
|
||||
|
@ -29,7 +28,21 @@ 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
|
||||
end
|
||||
|
||||
function love.update(dt)
|
||||
windowx, windowy, _ =love.window.getPosition()
|
||||
--movement keys
|
||||
for i, v in ipairs(movement) do
|
||||
v:update(dt)
|
||||
|
@ -42,7 +55,9 @@ function love.update(dt)
|
|||
end
|
||||
|
||||
function love.draw()
|
||||
love.graphics.setBackgroundColor(1, 179/255, 102/255)
|
||||
love.graphics.setBackgroundColor(0,0,0)
|
||||
--love.graphics.setBackgroundColor(1, 179/255, 102/255)
|
||||
--love.graphics.print("borderless = " .. (BORDERLESS and "true" or "false"), 0, 0)
|
||||
|
||||
--movement keys
|
||||
for i, v in ipairs(movement) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue