-
Notifications
You must be signed in to change notification settings - Fork 0
/
Screen.lua
45 lines (36 loc) · 835 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
36
37
38
39
40
41
42
43
44
45
Screen = {name = "", state = ""}
function Screen:new (name)
inst = {name = name, state = name}
setmetatable(inst, self)
self.__index = self
return inst
end
function Screen:init ()
print("init base Screen class")
end
function Screen:updateInput (event)
print("update input base Screen class")
end
function Screen:update ()
print("update base Screen class")
end
function Screen:draw ()
print("draw base Screen class")
end
function Screen:exit ()
print("exit base Screen class")
end
function Screen:getName ()
if self.name == "" then
print("scene name is nil")
end
return self.name
end
-- This will be hold the state of the next screen to tansistion to.
-- If state == name then we stay on the same screen.
function Screen:getState ()
return self.state
end
function Screen:setState (state)
self.state = state
end