-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
261 lines (190 loc) · 8 KB
/
index.html
File metadata and controls
261 lines (190 loc) · 8 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Layout Reference</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Layout</h1>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>layout</strong></li>
</ul>
<h2>Examples</h2>
<ul class="nowrap">
<li><a href="examples/config.lua.html">config.lua</a></li>
<li><a href="examples/example-01.lua.html">example-01.lua</a></li>
<li><a href="examples/example-02.lua.html">example-02.lua</a></li>
<li><a href="examples/example-03.lua.html">example-03.lua</a></li>
<li><a href="examples/example-04.lua.html">example-04.lua</a></li>
<li><a href="examples/example-05.lua.html">example-05.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>layout</code></h1>
<p>
<h2>layout.lua</h2>
<p> A simple but powerful device and display-size independent layout manager for the Corona SDK.</p>
</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Layout:new">Layout:new ()</a></td>
<td class="summary">Constructor - build and return a new Layout object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layout:addRegion">Layout:addRegion (dimens)</a></td>
<td class="summary">addRegion - add a new region to the layout manager.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layout:removeRegion">Layout:removeRegion (id)</a></td>
<td class="summary">removeRegion - remove a region from the layout.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layout:adjustRegion">Layout:adjustRegion (dimens)</a></td>
<td class="summary">adjustRegion - change a region's size and/or position.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layout:regionRect">Layout:regionRect (id)</a></td>
<td class="summary">regionRect - return a display rect matching a specified region.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Layout:new"></a>
<strong>Layout:new ()</strong>
</dt>
<dd>
<p>Constructor - build and return a new Layout object. </p>
<p> The new Layout object will contain the following entries:</p>
<ul>
<li><code>pixel</code>: (<strong>number</strong>) content units for one screen pixel (assumes device to have square pixels;
if not, this value will represent the content units for one pixel in the largest screen dimension)</li>
<li><code>screen</code>: (<strong>region</strong>) content region for the full screen</li>
<li><code>stage</code>: (<strong>region</strong>) content region for the stage (generally the same as the screen minus the status bar)</li>
<li><code>pixels</code>: (<strong>region</strong>) special region for positioning and sizing by pixels</li>
</ul>
<h3>Returns:</h3>
<ol>
new Layout object
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> Layout = LayoutManager:new()</pre>
</ul>
</dd>
<dt>
<a name = "Layout:addRegion"></a>
<strong>Layout:addRegion (dimens)</strong>
</dt>
<dd>
addRegion - add a new region to the layout manager.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dimens</span>
<p> a table specifying the options for the new region:</p>
<ul>
<li><code>id</code>: (<strong><em>string</em></strong>) <strong>required</strong> unique identifier for the new region</li>
<li><code>sizeTo</code>: (<strong><em>string</em></strong>) id of region to size against (default: "stage")</li>
<li><code>width</code>: (<strong><em>number</em></strong>) new region width as a percentage of the <code>sizeTo</code> region (default: 100)</li>
<li><code>height</code>: (<strong><em>number</em></strong>) new region height as a percentage of the 'sizeTo' region (default: 100)</li>
<li><code>positionTo</code>: (<strong><em>string</em></strong>) id of region to position relative to (defaults to <code>sizeTo</code> region)</li>
<li><code>horizontal</code>: (<strong><em>string</em></strong>) one of: "before", "left", "center", "right", "after" (default: "center")</li>
<li><code>vertical</code>: (<strong><em>string</em></strong>) one of: "above", "top", "center", "bottom", "below" (default: "center")</li>
<li><code>padTo</code>: (<strong><em>string</em></strong>) id of region to pad relative to (defaults to <code>sizeTo</code> region)</li>
<li><code>padding</code>: (<strong><em>table</em></strong>) array of: <code>{top=#, right=#, bottom=#, left=#}</code> (all #'s default to 0)</li>
</ul>
</li>
</ul>
</dd>
<dt>
<a name = "Layout:removeRegion"></a>
<strong>Layout:removeRegion (id)</strong>
</dt>
<dd>
removeRegion - remove a region from the layout.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
id of the region to be removed
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Layout:removeRegion( <span class="string">"toolbar"</span> )</pre>
</ul>
</dd>
<dt>
<a name = "Layout:adjustRegion"></a>
<strong>Layout:adjustRegion (dimens)</strong>
</dt>
<dd>
adjustRegion - change a region's size and/or position.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dimens</span>
<p> a table specifying the adjustments for the region:</p>
<ul>
<li><code>id</code>: (<strong><em>string</em></strong>) <strong>required</strong> unique identifier for the new region</li>
<li><code>width</code>: (<strong><em>number</em></strong>) new region width in <em>content</em> units (default: no change)</li>
<li><code>height</code>: (<strong><em>number</em></strong>) new region height in <em>content</em> units (default: no change)</li>
<li><code>xCenter</code>: (<strong><em>number</em></strong>) new region horizontal center in <em>content</em> coordinates (default: no change)</li>
<li><code>yCenter</code>: (<strong><em>number</em></strong>) new region vertical center in <em>content</em> coordinates (default: no change)</li>
</ul>
</li>
</ul>
</dd>
<dt>
<a name = "Layout:regionRect"></a>
<strong>Layout:regionRect (id)</strong>
</dt>
<dd>
regionRect - return a display rect matching a specified region.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
id of the region for which to return a display rect
</li>
</ul>
<h3>Returns:</h3>
<ol>
ShapeObject (as returned by <a href="https://docs.coronalabs.com/api/library/display/newRect.html">display.newRect()</a>)
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> toolbarRect = Layout:regionRect( <span class="string">"toolbar"</span> )</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-06-22 17:03:47 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>