-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen1.lua
More file actions
81 lines (56 loc) · 1.66 KB
/
screen1.lua
File metadata and controls
81 lines (56 loc) · 1.66 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module(..., package.seeall)
--====================================================================--
-- SCENE: SCREEN 1
--====================================================================--
--[[
- Version: 1.3
- Made by Ricardo Rauber Pereira @ 2010
- Blog: http://rauberlabs.blogspot.com/
- Mail: ricardorauber@gmail.com
******************
- INFORMATION
******************
- Sample scene.
--]]
new = function ( params )
local localGroup = display.newGroup()
------------------
-- Display Objects
------------------
local name = display.newText("Fergal Condron",0,0,nil,30)
name.x = display.contentWidth/2
name.y = display.contentHeight/6
local stuNum = display.newText("D11127787",0,0,nil,30)
stuNum.x = display.contentWidth/2
stuNum.y = 2*display.contentHeight/6
local label = display.newText("Start Game", 0,0, nil, 30)
label:setTextColor(255,255,255)
label.x = display.contentWidth/2
label.y = 5*display.contentHeight/6
local touched = function ( event )
director:changeScene("screen2", "crossfade")
end
--====================================================================--
-- INITIALIZE
--====================================================================--
local initVars = function ()
------------------
-- Inserts
------------------
localGroup:insert( name )
localGroup:insert( stuNum )
localGroup:insert( label )
------------------
-- Listeners
------------------
label:addEventListener( "touch" , touched )
end
------------------
-- Initiate variables
------------------
initVars()
------------------
-- MUST return a display.newGroup()
------------------
return localGroup
end