aboutsummaryrefslogtreecommitdiff
path: root/core/notifications.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/notifications.lua')
-rw-r--r--core/notifications.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/notifications.lua b/core/notifications.lua
new file mode 100644
index 0000000..05950f2
--- /dev/null
+++ b/core/notifications.lua
@@ -0,0 +1,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 \ No newline at end of file