aboutsummaryrefslogtreecommitdiff
path: root/core/notifications.lua
blob: 05950f2834a5bac3dead4ac8d2b7c5df2192e8ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Class = require("libs.hump.class")
Timer = require("libs.hump.timer")
Notifications = Class {
    init = function(self, zoomFactor)
        color = {1, 0, 0, 1}
        local windowWidth, windowHeight = love.graphics.getDimensions()
    end,
    _message={}
}

function Notifications:update(dt)
    Timer.update(dt)
end

function Notifications:draw()
    if self._message then
        love.graphics.setColor(color)
        love.graphics.print(self._message, 10, wind)
    end
end

function Notifications:send(message)
    self._message = message
    color = {1, 0, 0, 1}
    if Timer then
        Timer.clear()
    end
    Timer.tween(5, color, {0, 0, 0, 0}, 'linear')
end

return Notifications