Skip to content

Commit

Permalink
Fixed the test
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomayobre committed Oct 10, 2016
1 parent 533550e commit 57a8351
Show file tree
Hide file tree
Showing 7 changed files with 1,767 additions and 1,723 deletions.
57 changes: 17 additions & 40 deletions conf.lua
Original file line number Diff line number Diff line change
@@ -1,43 +1,20 @@
function love.conf(t)
t.title = "Material-Love"
t.author = "Positive07 - Pablo Mayobre"
t.url = "https://www.github.com/Positive07/material-love"
t.license = "MIT License - Copyright (c) 2015 Pablo Mayobre"
t.title = "Material-Love"
t.author = "Pablo A. Mayobre - Positive07"
t.url = "https://www.github.com/Positive07/material-love"
t.license = "MIT License - Copyright (c) 2015-2016 Pablo A. Mayobre (Positive07)"

t.identity = "Material-Love" -- The name of the save directory (string)
t.version = "0.9.0" -- The LÖVE version this game was made for (string)
t.console = false -- Attach a console (boolean, Windows only)
t.window.title = "Material-Love" -- The window title (string)
t.window.icon = "material-love/images/icon32.png" -- Filepath to an image to use as the window's icon (string)
t.window.width = 400 -- The window width (number)
t.window.height = 400 -- The window height (number)
t.window.borderless = false -- Remove all border visuals from the window (boolean)
t.window.resizable = false -- Let the window be user-resizable (boolean)
t.window.minwidth = 1 -- Minimum window width if the window is resizable (number)
t.window.minheight = 1 -- Minimum window height if the window is resizable (number)
t.window.fullscreen = false -- Enable fullscreen (boolean)
t.window.fullscreentype = "desktop" -- Standard fullscreen or desktop fullscreen mode (string)
t.window.vsync = true -- Enable vertical sync (boolean)
t.window.fsaa = 1 -- The number of samples to use with multi-sampled antialiasing (number)
t.window.msaa = 1 -- The number of samples to use with multi-sampled antialiasing (number)
t.window.display = 1 -- Index of the monitor to show the window in (number)
t.window.highdpi = true -- Enable high-dpi mode for the window on a Retina display (boolean)
t.window.srgb = false -- Enable sRGB gamma correction when drawing to the screen (boolean)
t.window.x = nil -- The x-coordinate of the window's position in the specified display (number)
t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
t.identity = "Material-Love" -- The name of the save directory (string)
t.window.title = "Material-Love" -- The window title (string)
t.window.icon = "material-love/images/icon32.png" -- Filepath to an image to use as the window's icon (string)
t.window.width = 400 -- The window width (number)
t.window.height = 400 -- The window height (number)
t.window.highdpi = true -- Enable high-dpi mode for the window on a Retina display (boolean)

t.modules.audio = false -- Enable the audio module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.image = true -- Enable the image module (boolean)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.math = false -- Enable the math module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
t.modules.sound = false -- Enable the sound module (boolean)
t.modules.system = true -- Enable the system module (boolean)
t.modules.timer = true -- Enable the timer module (boolean)
t.modules.window = true -- Enable the window module (boolean)
t.modules.thread = false -- Enable the thread module (boolean)
end
t.modules.video = false -- Enable the video module (boolean)
t.modules.audio = false -- Enable the audio module (boolean)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
t.modules.sound = false -- Enable the sound module (boolean)
t.modules.thread = false -- Enable the thread module (boolean)
end
50 changes: 23 additions & 27 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ io.stdout:setvbuf("no")

local m
local lw,lg = love.window,love.graphics
local li = love.image.newImageData
--local li = love.image.newImageData
local w, h, ps

local AppBar, Card, Circle, Back, Accept, Cancel, Toast

local click, i, cursor, hover, hf
local click--, i, cursor, hover, hf

local Collisions = {
circle = function (x,y,c,f,e)
local f = f or function () end
local e = e or function () end
f = f or function () end
e = e or function () end

if (x - c.x)^2 + (y - c.y)^2 < c.r ^ 2 then
f(x,y,c)
Expand All @@ -22,10 +22,10 @@ local Collisions = {
end,

box = function (x,y,b,t,f,e)
local f = f or function () end
local e = e or function () end
f = f or function () end
e = e or function () end

local t = t or {}
t = t or {}
if x > b.x - (t[1] or 0) and
y > b.y - (t[2] or 0) and
x < (b.x + b.w) + (t[3] or 0) and
Expand All @@ -39,11 +39,7 @@ local Collisions = {
}

love.load = function ()
local a = love.timer.getTime()
m = require "material-love"
local b = love.timer.getTime()

print (b - a)

-- i = lg.newImage("material-love/images/nine-patch.png")
-- m.nine.convert(i, "shadow",true)
Expand Down Expand Up @@ -102,13 +98,13 @@ love.load = function ()
t = 0,
inside = false,
out = true,
nupdate = function (Toast,dt)
Toast.t = Toast.t + dt
local p = Toast.t/0.5
Toast.h = Toast.fh * (-p * (p - 2))
nupdate = function (self, dt)
self.t = self.t + dt
local p = self.t/0.5
self.h = self.fh * (-p * (p - 2))

if Toast.t > 0.5 then
Toast.update = function () end
if self.t > 0.5 then
self.update = function () end
end
end
}
Expand Down Expand Up @@ -154,9 +150,9 @@ love.draw = function ()
lg.line(Card.x + 16 * ps, Card.y + 40 * ps, Card.x + Card.w - 16 * ps, Card.y + 40 * ps)
lg.setColor(m.colors.mono("black", "body"))
lg.setFont(m.roboto "body1")
lg.printf([[Material-love provides functions to easily recreate the material-design functionalities in Love, such as ripples and shadows.
lg.printf([[Material-Love provides functions to easily recreate the material-design functionalities in Love, such as ripples and shadows.
Go to the repo by clicking the heart or close this form with the back arrow in the AppBar. You can also open the toasts by clicking any of the two buttons in the bottom of the card.
PS: Enjoy the ripples!]], Card.x + 16 * ps, Card.y + 48 * ps, Card.w - 32 * ps)

lg.setColor(m.colors("grey", "400"))
Expand Down Expand Up @@ -201,13 +197,13 @@ love.mousepressed = function (x,y,b)
if Toast.inside then
Toast.inside = false
Toast.t = 0
Toast.update = function (Toast, dt)
Toast.t = Toast.t + dt
local p = Toast.t/0.5
Toast.h = Toast.fh - Toast.fh * (-p * (p - 2))
Toast.update = function (self, dt)
self.t = self.t + dt
local p = self.t/0.5
self.h = self.fh - self.fh * (-p * (p - 2))

if Toast.t > 0.5 then
Toast.out = true
if self.t > 0.5 then
self.out = true
end
end
end
Expand Down Expand Up @@ -247,11 +243,11 @@ love.mousepressed = function (x,y,b)
end)
end

love.mousereleased = function (x,y,b)
love.mousereleased = function ()
Accept.ripple:fade()
Cancel.ripple:fade()
Back:fade()
Circle:fade()

if click then love.event.quit() end
end
end
Binary file modified material-love/assets/icons.ttf
Binary file not shown.
6 changes: 3 additions & 3 deletions material-love/libs/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ local isSRGB = love.graphics.isGammaCorrect and love.graphics.isGammaCorrect() o
end

local convert = function (color)
if isSRGB then
if isSRGB() then
return love.math.linearToGamma(color)
else
return unpack(color)
Expand Down Expand Up @@ -439,12 +439,12 @@ function colors.background (l)

if l ~= "light" then
if l == "dark" then
return convert(colors["blue-grey"]["800"])
return convert(_c["blue-grey"]["800"])
else
error ("Argument #1 to background, is not light nor black", 2)
end
else
return convert(colors["grey"]["50"])
return convert(_c["grey"]["50"])
end
end

Expand Down
Loading

0 comments on commit 57a8351

Please sign in to comment.