-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
101 lines (74 loc) · 2.69 KB
/
README
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Modified 17th August Giles Allensby
***** SimpleLoopLib for Gideros Studio ****
**********************************
Simply add files to project
Lua API
//Printed tables will display their contents in the debugger
screenW returns screen Width
screenH returns screen Height
---------------- Shape Functions -------------
Shape:setFillColor((int 0-255) r, (int 0-255) g, (int 0-255) b)
Shape:setPos(int x, int y)
---------------- Image Functions -------------
Bitmap:setReferencePoint(display.pos or {(float 0-1) x, (float 0-1) y}) -- See Possible Reference Points Below
Bitmap:setFillColor((int 0-255) r, (int 0-255) g, (int 0-255) b)
Bitmap:setPos(int x, int y)
Bitmap:setScaleP(float scale)
---------------- Text Functions -------------
TextField:setTextColorRGB(TextField field, (int 0-255) r, (int 0-255) g, (int 0-255) b)
---------------- Possible Reference Points -------------
display.c = Center
display.cr = Center Right
display.cl = Center Left
display.tl = Top Left
display.tr = Top Right
display.bl = Bottom Left
display.br = Bottom Right
display.contentWidth = screen Width
display.contentHeight = screen Height
---------------- Display Functions -------------
--Rectangle
local rect = display.newRect(int x, int y, int width, int height)
--Circle
local circle = display.newCircle(int x, int y, int radius)
--Elipse
local elipse = display.newElipse(int x, int y, int radiusX, int radiusY)
--Image
local image = display.newImage(string file, string baseDir or nil, int x, int y)
--group
local group = display.newGroup()
--text
local text = display.newText(string text, int x, int y, font)
---------------- Easy Animted Sprite Function -------------
The texturepacker .png and .txt files must be in the same location
spriteName is the file name without the .png or .txt on the end
local player = loadSprite(string spriteName, int startFrame, int endFrame)
---------------- Transition Functions ----------------
transition.to(tweens, params)
tweens may be table of objects {playBtn, optionsBtn} or single object playBtn
possible params standard params and delay, ease, repeatCount, reflect, time
:: EXAMPLE ::
local playBtn = display.newImage("playBtn.png",nil, 100, 100)
transition.to(self.playBtn, {time=500, y=-60})
---------------- Saving and Loading Functions ----------------
Defaults is the data
:: DEFAULTS EXAMPLE ::
Defaults ({
bestScore = 200
volume = .4
})
:: FIRST LOAD EXAMPLE ::
canLoad = Load()
if canLoad == false then
Save() -- Saves defaults to file
end
:: SAVING EXAMPLE ::
local myData = {}
myData.bestScore = 500
myData.volume = .8
Save(myData)
:: LOADING EXAMPLE ::
local myData = Load()
print(myData.bestScore) <== 500
print(myData.volume) <== .8
]]