-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreen.lua
35 lines (30 loc) · 803 Bytes
/
screen.lua
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
32
33
34
35
-- screen.lua
-- table for creation of different screens that have only text, like splash screen, end screen and so on
gui = require "gui"
local Screen = {}
local text_x = 25
local text_y = 50
-- How long should the splash be visible
Screen.stay = 1
-- Variable for storing the showing of screen
Screen.show = false
-- Variable for storing name of screen
Screen.name = ""
Screen.text = ""
function Screen:new(name, text, stay)
Screen.name = name
Screen.stime = love.timer.getTime()
Screen.text = text
Screen.stay = stay
return Screen
end
function Screen:draw(stime)
gui:echo(Screen.text, text_x, text_y)
--if (love.timer.getTime() - Screen.stime) > Screen.stay then
-- Screen.show = false
--end
end
function Screen:append(text)
Screen.text = Screen.text .. text
end
return Screen