( I've still left some code that isn't SUIT related )
Code: Select all
suit = require 'suit'
function env_set()
-- Set background color to minimalist gray
love.graphics.setBackgroundColor(91, 81, 81)
-- Create & Set fonts
fnt_dir = "assets/fonts/Raleway-Thin.ttf" -- Font Directory
small = love.graphics.newFont(fnt_dir, 30)
medium = love.graphics.newFont(fnt_dir, 50)
big = love.graphics.newFont(fnt_dir, 60)
large = love.graphics.newFont(fnt_dir, 80)
extralarge = love.graphics.newFont(fnt_dir, 100)
love.graphics.setFont(medium)
-- Customize Button
suit.theme.color.normal = {bg = {158, 142, 142}, fg = {255, 255, 255}}
suit.theme.color.hovered = {bg = {119, 107, 107}, fg = {255, 255, 255}}
suit.theme.color.active = {bg = {100, 100, 100}, fg = {255, 255, 255}}
end
function env_update(dt)
-- Create a start button
if suit.Button("START", love.graphics.getWidth() * 0.5 - 100, 200, 250, 100).hit then
-- If the button is clicked then go to the playing state
gamestate = "playing"
end
end
function env_draw()
-- Game title
love.graphics.setFont(extralarge)
love.graphics.setColor(196, 176, 176)
love.graphics.print("GRID", 10, love.graphics.getWidth() * 0.5 - 50)
-- Draw all suit ui
love.graphics.setFont(big) -- Set font to big for the suit ui elements
suit.draw()
end