fantasy 0.1.11 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +22 -1
- data/.yardopts +4 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +55 -0
- data/README.md +36 -13
- data/docs/Actor.html +2737 -0
- data/docs/Background.html +961 -0
- data/docs/Camera.html +791 -0
- data/docs/Clock.html +753 -0
- data/docs/Color.html +776 -0
- data/docs/Coordinates.html +730 -0
- data/docs/Cursor.html +752 -0
- data/docs/Disk.html +236 -0
- data/docs/Draggable.html +198 -0
- data/docs/Fantasy.html +121 -0
- data/docs/Game.html +904 -0
- data/docs/Global.html +2791 -0
- data/docs/Gravitier.html +179 -0
- data/docs/HudImage.html +979 -0
- data/docs/HudText.html +1151 -0
- data/docs/Image.html +506 -0
- data/docs/Jumper.html +189 -0
- data/docs/Mouse.html +226 -0
- data/docs/MoveByCursor.html +374 -0
- data/docs/MoveByDirection.html +179 -0
- data/docs/Mover.html +305 -0
- data/docs/Music.html +524 -0
- data/docs/Shape.html +1057 -0
- data/docs/Sound.html +374 -0
- data/docs/Tilemap.html +491 -0
- data/docs/Tween.html +186 -0
- data/docs/UserInputs.html +879 -0
- data/docs/Utils.html +345 -0
- data/docs/_index.html +346 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +497 -0
- data/docs/file.CHANGELOG.html +121 -0
- data/docs/file.README.html +599 -0
- data/docs/file_list.html +61 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +599 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1931 -0
- data/docs/top-level-namespace.html +978 -0
- data/lib/fantasy/actor.rb +455 -112
- data/lib/fantasy/background.rb +109 -13
- data/lib/fantasy/base.rb +113 -1
- data/lib/fantasy/camera.rb +95 -11
- data/lib/fantasy/clock.rb +4 -2
- data/lib/fantasy/color.rb +158 -153
- data/lib/fantasy/coordinates.rb +5 -9
- data/lib/fantasy/cursor.rb +22 -0
- data/lib/fantasy/disk.rb +35 -0
- data/lib/fantasy/draggable.rb +22 -1
- data/lib/fantasy/global.rb +59 -31
- data/lib/fantasy/hud_image.rb +5 -3
- data/lib/fantasy/hud_text.rb +9 -3
- data/lib/fantasy/image.rb +12 -4
- data/lib/fantasy/includes/gravitier.rb +2 -0
- data/lib/fantasy/includes/jumper.rb +3 -2
- data/lib/fantasy/includes/log.rb +12 -0
- data/lib/fantasy/includes/move_by_cursors.rb +24 -15
- data/lib/fantasy/includes/move_by_direction.rb +2 -0
- data/lib/fantasy/includes/mover.rb +7 -0
- data/lib/fantasy/includes/user_inputs.rb +6 -0
- data/lib/fantasy/loop.rb +41 -44
- data/lib/fantasy/mouse.rb +2 -0
- data/lib/fantasy/music.rb +7 -3
- data/lib/fantasy/shape.rb +11 -2
- data/lib/fantasy/sound.rb +5 -3
- data/lib/fantasy/tilemap.rb +19 -13
- data/lib/fantasy/tween.rb +3 -1
- data/lib/fantasy/utils.rb +7 -13
- data/lib/fantasy/version.rb +1 -1
- data/lib/fantasy.rb +3 -0
- metadata +91 -4
- data/fantasy.gemspec +0 -40
- data/fonts/VT323-Regular.ttf +0 -0
data/docs/Shape.html
ADDED
@@ -0,0 +1,1057 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Shape
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.27
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Shape";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (S)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Shape</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Shape
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Shape</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd><span class='object_link'><a href="UserInputs.html" title="UserInputs (module)">UserInputs</a></span></dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/fantasy/shape.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
112
|
+
<ul class="summary">
|
113
|
+
|
114
|
+
<li class="public ">
|
115
|
+
<span class="summary_signature">
|
116
|
+
|
117
|
+
<a href="#color-instance_method" title="#color (instance method)">#<strong>color</strong> ⇒ Object </a>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
</span>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute color.</p>
|
135
|
+
</div></span>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
|
139
|
+
|
140
|
+
<li class="public ">
|
141
|
+
<span class="summary_signature">
|
142
|
+
|
143
|
+
<a href="#fill-instance_method" title="#fill (instance method)">#<strong>fill</strong> ⇒ Object </a>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</span>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute fill.</p>
|
161
|
+
</div></span>
|
162
|
+
|
163
|
+
</li>
|
164
|
+
|
165
|
+
|
166
|
+
<li class="public ">
|
167
|
+
<span class="summary_signature">
|
168
|
+
|
169
|
+
<a href="#height-instance_method" title="#height (instance method)">#<strong>height</strong> ⇒ Object </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute height.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
<li class="public ">
|
193
|
+
<span class="summary_signature">
|
194
|
+
|
195
|
+
<a href="#kind-instance_method" title="#kind (instance method)">#<strong>kind</strong> ⇒ Object </a>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</span>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute kind.</p>
|
213
|
+
</div></span>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
<li class="public ">
|
219
|
+
<span class="summary_signature">
|
220
|
+
|
221
|
+
<a href="#layer-instance_method" title="#layer (instance method)">#<strong>layer</strong> ⇒ Object </a>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</span>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute layer.</p>
|
239
|
+
</div></span>
|
240
|
+
|
241
|
+
</li>
|
242
|
+
|
243
|
+
|
244
|
+
<li class="public ">
|
245
|
+
<span class="summary_signature">
|
246
|
+
|
247
|
+
<a href="#position-instance_method" title="#position (instance method)">#<strong>position</strong> ⇒ Object </a>
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</span>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute position.</p>
|
265
|
+
</div></span>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
|
270
|
+
<li class="public ">
|
271
|
+
<span class="summary_signature">
|
272
|
+
|
273
|
+
<a href="#stroke-instance_method" title="#stroke (instance method)">#<strong>stroke</strong> ⇒ Object </a>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute stroke.</p>
|
291
|
+
</div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
<li class="public ">
|
297
|
+
<span class="summary_signature">
|
298
|
+
|
299
|
+
<a href="#stroke_color-instance_method" title="#stroke_color (instance method)">#<strong>stroke_color</strong> ⇒ Object </a>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
</span>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute stroke_color.</p>
|
317
|
+
</div></span>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
|
322
|
+
<li class="public ">
|
323
|
+
<span class="summary_signature">
|
324
|
+
|
325
|
+
<a href="#width-instance_method" title="#width (instance method)">#<strong>width</strong> ⇒ Object </a>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute width.</p>
|
343
|
+
</div></span>
|
344
|
+
|
345
|
+
</li>
|
346
|
+
|
347
|
+
|
348
|
+
</ul>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
<h2>
|
355
|
+
Class Method Summary
|
356
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
357
|
+
</h2>
|
358
|
+
|
359
|
+
<ul class="summary">
|
360
|
+
|
361
|
+
<li class="public ">
|
362
|
+
<span class="summary_signature">
|
363
|
+
|
364
|
+
<a href="#rectangle-class_method" title="rectangle (class method)">.<strong>rectangle</strong>(position:, width:, height:, color: Color.palette.black, stroke_color: nil, stroke: 0) ⇒ Object </a>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
</span>
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
<span class="summary_desc"><div class='inline'><p>rubocop:enable Metrics/ParameterLists.</p>
|
379
|
+
</div></span>
|
380
|
+
|
381
|
+
</li>
|
382
|
+
|
383
|
+
|
384
|
+
</ul>
|
385
|
+
|
386
|
+
<h2>
|
387
|
+
Instance Method Summary
|
388
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
389
|
+
</h2>
|
390
|
+
|
391
|
+
<ul class="summary">
|
392
|
+
|
393
|
+
<li class="public ">
|
394
|
+
<span class="summary_signature">
|
395
|
+
|
396
|
+
<a href="#destroy-instance_method" title="#destroy (instance method)">#<strong>destroy</strong> ⇒ Object </a>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</span>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
411
|
+
|
412
|
+
</li>
|
413
|
+
|
414
|
+
|
415
|
+
<li class="public ">
|
416
|
+
<span class="summary_signature">
|
417
|
+
|
418
|
+
<a href="#draw-instance_method" title="#draw (instance method)">#<strong>draw</strong> ⇒ Object </a>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
</span>
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
433
|
+
|
434
|
+
</li>
|
435
|
+
|
436
|
+
|
437
|
+
<li class="public ">
|
438
|
+
<span class="summary_signature">
|
439
|
+
|
440
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(kind:, position:, width:, height:, stroke: 1, fill: true, color: Color.palette.black, stroke_color: nil) ⇒ Shape </a>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
</span>
|
445
|
+
|
446
|
+
|
447
|
+
<span class="note title constructor">constructor</span>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
<span class="summary_desc"><div class='inline'><p>rubocop:disable Metrics/ParameterLists.</p>
|
457
|
+
</div></span>
|
458
|
+
|
459
|
+
</li>
|
460
|
+
|
461
|
+
|
462
|
+
</ul>
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="UserInputs.html" title="UserInputs (module)">UserInputs</a></span></h3>
|
475
|
+
<p class="inherited"><span class='object_link'><a href="UserInputs.html#on_click-instance_method" title="UserInputs#on_click (method)">#on_click</a></span>, <span class='object_link'><a href="UserInputs.html#on_click_do-instance_method" title="UserInputs#on_click_do (method)">#on_click_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_down-instance_method" title="UserInputs#on_cursor_down (method)">#on_cursor_down</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_down_do-instance_method" title="UserInputs#on_cursor_down_do (method)">#on_cursor_down_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_left-instance_method" title="UserInputs#on_cursor_left (method)">#on_cursor_left</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_left_do-instance_method" title="UserInputs#on_cursor_left_do (method)">#on_cursor_left_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_right-instance_method" title="UserInputs#on_cursor_right (method)">#on_cursor_right</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_right_do-instance_method" title="UserInputs#on_cursor_right_do (method)">#on_cursor_right_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_up-instance_method" title="UserInputs#on_cursor_up (method)">#on_cursor_up</a></span>, <span class='object_link'><a href="UserInputs.html#on_cursor_up_do-instance_method" title="UserInputs#on_cursor_up_do (method)">#on_cursor_up_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_mouse_button_left-instance_method" title="UserInputs#on_mouse_button_left (method)">#on_mouse_button_left</a></span>, <span class='object_link'><a href="UserInputs.html#on_mouse_button_left_do-instance_method" title="UserInputs#on_mouse_button_left_do (method)">#on_mouse_button_left_do</a></span>, <span class='object_link'><a href="UserInputs.html#on_space_bar-instance_method" title="UserInputs#on_space_bar (method)">#on_space_bar</a></span>, <span class='object_link'><a href="UserInputs.html#on_space_bar_do-instance_method" title="UserInputs#on_space_bar_do (method)">#on_space_bar_do</a></span></p>
|
476
|
+
<div id="constructor_details" class="method_details_list">
|
477
|
+
<h2>Constructor Details</h2>
|
478
|
+
|
479
|
+
<div class="method_details first">
|
480
|
+
<h3 class="signature first" id="initialize-instance_method">
|
481
|
+
|
482
|
+
#<strong>initialize</strong>(kind:, position:, width:, height:, stroke: 1, fill: true, color: Color.palette.black, stroke_color: nil) ⇒ <tt><span class='object_link'><a href="" title="Shape (class)">Shape</a></span></tt>
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
</h3><div class="docstring">
|
489
|
+
<div class="discussion">
|
490
|
+
<p>rubocop:disable Metrics/ParameterLists</p>
|
491
|
+
|
492
|
+
|
493
|
+
</div>
|
494
|
+
</div>
|
495
|
+
<div class="tags">
|
496
|
+
|
497
|
+
|
498
|
+
</div><table class="source_code">
|
499
|
+
<tr>
|
500
|
+
<td>
|
501
|
+
<pre class="lines">
|
502
|
+
|
503
|
+
|
504
|
+
9
|
505
|
+
10
|
506
|
+
11
|
507
|
+
12
|
508
|
+
13
|
509
|
+
14
|
510
|
+
15
|
511
|
+
16
|
512
|
+
17
|
513
|
+
18
|
514
|
+
19
|
515
|
+
20
|
516
|
+
21</pre>
|
517
|
+
</td>
|
518
|
+
<td>
|
519
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 9</span>
|
520
|
+
|
521
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>kind:</span><span class='comma'>,</span> <span class='label'>position:</span><span class='comma'>,</span> <span class='label'>width:</span><span class='comma'>,</span> <span class='label'>height:</span><span class='comma'>,</span> <span class='label'>stroke:</span> <span class='int'>1</span><span class='comma'>,</span> <span class='label'>fill:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Color.html" title="Color (class)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_palette'><span class='object_link'><a href="Color.html#palette-class_method" title="Color.palette (method)">palette</a></span></span><span class='period'>.</span><span class='id identifier rubyid_black'>black</span><span class='comma'>,</span> <span class='label'>stroke_color:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
522
|
+
<span class='ivar'>@kind</span> <span class='op'>=</span> <span class='id identifier rubyid_kind'>kind</span>
|
523
|
+
<span class='ivar'>@position</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span>
|
524
|
+
<span class='ivar'>@width</span> <span class='op'>=</span> <span class='id identifier rubyid_width'>width</span>
|
525
|
+
<span class='ivar'>@height</span> <span class='op'>=</span> <span class='id identifier rubyid_height'>height</span>
|
526
|
+
<span class='ivar'>@stroke</span> <span class='op'>=</span> <span class='id identifier rubyid_stroke'>stroke</span>
|
527
|
+
<span class='ivar'>@color</span> <span class='op'>=</span> <span class='id identifier rubyid_color'>color</span>
|
528
|
+
<span class='ivar'>@fill</span> <span class='op'>=</span> <span class='id identifier rubyid_fill'>fill</span>
|
529
|
+
<span class='ivar'>@stroke_color</span> <span class='op'>=</span> <span class='id identifier rubyid_stroke_color'>stroke_color</span>
|
530
|
+
<span class='ivar'>@layer</span> <span class='op'>=</span> <span class='int'>1</span>
|
531
|
+
|
532
|
+
<span class='const'><span class='object_link'><a href="Global.html" title="Global (module)">Global</a></span></span><span class='period'>.</span><span class='id identifier rubyid_shapes'><span class='object_link'><a href="Global.html#shapes-class_method" title="Global.shapes (method)">shapes</a></span></span> <span class='op'><<</span> <span class='kw'>self</span>
|
533
|
+
<span class='kw'>end</span></pre>
|
534
|
+
</td>
|
535
|
+
</tr>
|
536
|
+
</table>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div id="instance_attr_details" class="attr_details">
|
542
|
+
<h2>Instance Attribute Details</h2>
|
543
|
+
|
544
|
+
|
545
|
+
<span id="color=-instance_method"></span>
|
546
|
+
<div class="method_details first">
|
547
|
+
<h3 class="signature first" id="color-instance_method">
|
548
|
+
|
549
|
+
#<strong>color</strong> ⇒ <tt>Object</tt>
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
</h3><div class="docstring">
|
556
|
+
<div class="discussion">
|
557
|
+
<p>Returns the value of attribute color.</p>
|
558
|
+
|
559
|
+
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
<div class="tags">
|
563
|
+
|
564
|
+
|
565
|
+
</div><table class="source_code">
|
566
|
+
<tr>
|
567
|
+
<td>
|
568
|
+
<pre class="lines">
|
569
|
+
|
570
|
+
|
571
|
+
6
|
572
|
+
7
|
573
|
+
8</pre>
|
574
|
+
</td>
|
575
|
+
<td>
|
576
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
577
|
+
|
578
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_color'>color</span>
|
579
|
+
<span class='ivar'>@color</span>
|
580
|
+
<span class='kw'>end</span></pre>
|
581
|
+
</td>
|
582
|
+
</tr>
|
583
|
+
</table>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
|
587
|
+
<span id="fill=-instance_method"></span>
|
588
|
+
<div class="method_details ">
|
589
|
+
<h3 class="signature " id="fill-instance_method">
|
590
|
+
|
591
|
+
#<strong>fill</strong> ⇒ <tt>Object</tt>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
</h3><div class="docstring">
|
598
|
+
<div class="discussion">
|
599
|
+
<p>Returns the value of attribute fill.</p>
|
600
|
+
|
601
|
+
|
602
|
+
</div>
|
603
|
+
</div>
|
604
|
+
<div class="tags">
|
605
|
+
|
606
|
+
|
607
|
+
</div><table class="source_code">
|
608
|
+
<tr>
|
609
|
+
<td>
|
610
|
+
<pre class="lines">
|
611
|
+
|
612
|
+
|
613
|
+
6
|
614
|
+
7
|
615
|
+
8</pre>
|
616
|
+
</td>
|
617
|
+
<td>
|
618
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
619
|
+
|
620
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fill'>fill</span>
|
621
|
+
<span class='ivar'>@fill</span>
|
622
|
+
<span class='kw'>end</span></pre>
|
623
|
+
</td>
|
624
|
+
</tr>
|
625
|
+
</table>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
|
629
|
+
<span id="height=-instance_method"></span>
|
630
|
+
<div class="method_details ">
|
631
|
+
<h3 class="signature " id="height-instance_method">
|
632
|
+
|
633
|
+
#<strong>height</strong> ⇒ <tt>Object</tt>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
</h3><div class="docstring">
|
640
|
+
<div class="discussion">
|
641
|
+
<p>Returns the value of attribute height.</p>
|
642
|
+
|
643
|
+
|
644
|
+
</div>
|
645
|
+
</div>
|
646
|
+
<div class="tags">
|
647
|
+
|
648
|
+
|
649
|
+
</div><table class="source_code">
|
650
|
+
<tr>
|
651
|
+
<td>
|
652
|
+
<pre class="lines">
|
653
|
+
|
654
|
+
|
655
|
+
6
|
656
|
+
7
|
657
|
+
8</pre>
|
658
|
+
</td>
|
659
|
+
<td>
|
660
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
661
|
+
|
662
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_height'>height</span>
|
663
|
+
<span class='ivar'>@height</span>
|
664
|
+
<span class='kw'>end</span></pre>
|
665
|
+
</td>
|
666
|
+
</tr>
|
667
|
+
</table>
|
668
|
+
</div>
|
669
|
+
|
670
|
+
|
671
|
+
<span id="kind=-instance_method"></span>
|
672
|
+
<div class="method_details ">
|
673
|
+
<h3 class="signature " id="kind-instance_method">
|
674
|
+
|
675
|
+
#<strong>kind</strong> ⇒ <tt>Object</tt>
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</h3><div class="docstring">
|
682
|
+
<div class="discussion">
|
683
|
+
<p>Returns the value of attribute kind.</p>
|
684
|
+
|
685
|
+
|
686
|
+
</div>
|
687
|
+
</div>
|
688
|
+
<div class="tags">
|
689
|
+
|
690
|
+
|
691
|
+
</div><table class="source_code">
|
692
|
+
<tr>
|
693
|
+
<td>
|
694
|
+
<pre class="lines">
|
695
|
+
|
696
|
+
|
697
|
+
6
|
698
|
+
7
|
699
|
+
8</pre>
|
700
|
+
</td>
|
701
|
+
<td>
|
702
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
703
|
+
|
704
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_kind'>kind</span>
|
705
|
+
<span class='ivar'>@kind</span>
|
706
|
+
<span class='kw'>end</span></pre>
|
707
|
+
</td>
|
708
|
+
</tr>
|
709
|
+
</table>
|
710
|
+
</div>
|
711
|
+
|
712
|
+
|
713
|
+
<span id="layer=-instance_method"></span>
|
714
|
+
<div class="method_details ">
|
715
|
+
<h3 class="signature " id="layer-instance_method">
|
716
|
+
|
717
|
+
#<strong>layer</strong> ⇒ <tt>Object</tt>
|
718
|
+
|
719
|
+
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
</h3><div class="docstring">
|
724
|
+
<div class="discussion">
|
725
|
+
<p>Returns the value of attribute layer.</p>
|
726
|
+
|
727
|
+
|
728
|
+
</div>
|
729
|
+
</div>
|
730
|
+
<div class="tags">
|
731
|
+
|
732
|
+
|
733
|
+
</div><table class="source_code">
|
734
|
+
<tr>
|
735
|
+
<td>
|
736
|
+
<pre class="lines">
|
737
|
+
|
738
|
+
|
739
|
+
6
|
740
|
+
7
|
741
|
+
8</pre>
|
742
|
+
</td>
|
743
|
+
<td>
|
744
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
745
|
+
|
746
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_layer'>layer</span>
|
747
|
+
<span class='ivar'>@layer</span>
|
748
|
+
<span class='kw'>end</span></pre>
|
749
|
+
</td>
|
750
|
+
</tr>
|
751
|
+
</table>
|
752
|
+
</div>
|
753
|
+
|
754
|
+
|
755
|
+
<span id="position=-instance_method"></span>
|
756
|
+
<div class="method_details ">
|
757
|
+
<h3 class="signature " id="position-instance_method">
|
758
|
+
|
759
|
+
#<strong>position</strong> ⇒ <tt>Object</tt>
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
</h3><div class="docstring">
|
766
|
+
<div class="discussion">
|
767
|
+
<p>Returns the value of attribute position.</p>
|
768
|
+
|
769
|
+
|
770
|
+
</div>
|
771
|
+
</div>
|
772
|
+
<div class="tags">
|
773
|
+
|
774
|
+
|
775
|
+
</div><table class="source_code">
|
776
|
+
<tr>
|
777
|
+
<td>
|
778
|
+
<pre class="lines">
|
779
|
+
|
780
|
+
|
781
|
+
6
|
782
|
+
7
|
783
|
+
8</pre>
|
784
|
+
</td>
|
785
|
+
<td>
|
786
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
787
|
+
|
788
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_position'>position</span>
|
789
|
+
<span class='ivar'>@position</span>
|
790
|
+
<span class='kw'>end</span></pre>
|
791
|
+
</td>
|
792
|
+
</tr>
|
793
|
+
</table>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
|
797
|
+
<span id="stroke=-instance_method"></span>
|
798
|
+
<div class="method_details ">
|
799
|
+
<h3 class="signature " id="stroke-instance_method">
|
800
|
+
|
801
|
+
#<strong>stroke</strong> ⇒ <tt>Object</tt>
|
802
|
+
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
</h3><div class="docstring">
|
808
|
+
<div class="discussion">
|
809
|
+
<p>Returns the value of attribute stroke.</p>
|
810
|
+
|
811
|
+
|
812
|
+
</div>
|
813
|
+
</div>
|
814
|
+
<div class="tags">
|
815
|
+
|
816
|
+
|
817
|
+
</div><table class="source_code">
|
818
|
+
<tr>
|
819
|
+
<td>
|
820
|
+
<pre class="lines">
|
821
|
+
|
822
|
+
|
823
|
+
6
|
824
|
+
7
|
825
|
+
8</pre>
|
826
|
+
</td>
|
827
|
+
<td>
|
828
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
829
|
+
|
830
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_stroke'>stroke</span>
|
831
|
+
<span class='ivar'>@stroke</span>
|
832
|
+
<span class='kw'>end</span></pre>
|
833
|
+
</td>
|
834
|
+
</tr>
|
835
|
+
</table>
|
836
|
+
</div>
|
837
|
+
|
838
|
+
|
839
|
+
<span id="stroke_color=-instance_method"></span>
|
840
|
+
<div class="method_details ">
|
841
|
+
<h3 class="signature " id="stroke_color-instance_method">
|
842
|
+
|
843
|
+
#<strong>stroke_color</strong> ⇒ <tt>Object</tt>
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
|
848
|
+
|
849
|
+
</h3><div class="docstring">
|
850
|
+
<div class="discussion">
|
851
|
+
<p>Returns the value of attribute stroke_color.</p>
|
852
|
+
|
853
|
+
|
854
|
+
</div>
|
855
|
+
</div>
|
856
|
+
<div class="tags">
|
857
|
+
|
858
|
+
|
859
|
+
</div><table class="source_code">
|
860
|
+
<tr>
|
861
|
+
<td>
|
862
|
+
<pre class="lines">
|
863
|
+
|
864
|
+
|
865
|
+
6
|
866
|
+
7
|
867
|
+
8</pre>
|
868
|
+
</td>
|
869
|
+
<td>
|
870
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
871
|
+
|
872
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_stroke_color'>stroke_color</span>
|
873
|
+
<span class='ivar'>@stroke_color</span>
|
874
|
+
<span class='kw'>end</span></pre>
|
875
|
+
</td>
|
876
|
+
</tr>
|
877
|
+
</table>
|
878
|
+
</div>
|
879
|
+
|
880
|
+
|
881
|
+
<span id="width=-instance_method"></span>
|
882
|
+
<div class="method_details ">
|
883
|
+
<h3 class="signature " id="width-instance_method">
|
884
|
+
|
885
|
+
#<strong>width</strong> ⇒ <tt>Object</tt>
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
</h3><div class="docstring">
|
892
|
+
<div class="discussion">
|
893
|
+
<p>Returns the value of attribute width.</p>
|
894
|
+
|
895
|
+
|
896
|
+
</div>
|
897
|
+
</div>
|
898
|
+
<div class="tags">
|
899
|
+
|
900
|
+
|
901
|
+
</div><table class="source_code">
|
902
|
+
<tr>
|
903
|
+
<td>
|
904
|
+
<pre class="lines">
|
905
|
+
|
906
|
+
|
907
|
+
6
|
908
|
+
7
|
909
|
+
8</pre>
|
910
|
+
</td>
|
911
|
+
<td>
|
912
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 6</span>
|
913
|
+
|
914
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
|
915
|
+
<span class='ivar'>@width</span>
|
916
|
+
<span class='kw'>end</span></pre>
|
917
|
+
</td>
|
918
|
+
</tr>
|
919
|
+
</table>
|
920
|
+
</div>
|
921
|
+
|
922
|
+
</div>
|
923
|
+
|
924
|
+
|
925
|
+
<div id="class_method_details" class="method_details_list">
|
926
|
+
<h2>Class Method Details</h2>
|
927
|
+
|
928
|
+
|
929
|
+
<div class="method_details first">
|
930
|
+
<h3 class="signature first" id="rectangle-class_method">
|
931
|
+
|
932
|
+
.<strong>rectangle</strong>(position:, width:, height:, color: Color.palette.black, stroke_color: nil, stroke: 0) ⇒ <tt>Object</tt>
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
|
937
|
+
|
938
|
+
</h3><div class="docstring">
|
939
|
+
<div class="discussion">
|
940
|
+
<p>rubocop:enable Metrics/ParameterLists</p>
|
941
|
+
|
942
|
+
|
943
|
+
</div>
|
944
|
+
</div>
|
945
|
+
<div class="tags">
|
946
|
+
|
947
|
+
|
948
|
+
</div><table class="source_code">
|
949
|
+
<tr>
|
950
|
+
<td>
|
951
|
+
<pre class="lines">
|
952
|
+
|
953
|
+
|
954
|
+
24
|
955
|
+
25
|
956
|
+
26</pre>
|
957
|
+
</td>
|
958
|
+
<td>
|
959
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 24</span>
|
960
|
+
|
961
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rectangle'>rectangle</span><span class='lparen'>(</span><span class='label'>position:</span><span class='comma'>,</span> <span class='label'>width:</span><span class='comma'>,</span> <span class='label'>height:</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Color.html" title="Color (class)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_palette'><span class='object_link'><a href="Color.html#palette-class_method" title="Color.palette (method)">palette</a></span></span><span class='period'>.</span><span class='id identifier rubyid_black'>black</span><span class='comma'>,</span> <span class='label'>stroke_color:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>stroke:</span> <span class='int'>0</span><span class='rparen'>)</span>
|
962
|
+
<span class='const'><span class='object_link'><a href="" title="Shape (class)">Shape</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Shape#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>kind:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>rectangle</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='id identifier rubyid_position'>position</span><span class='comma'>,</span> <span class='label'>width:</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='label'>height:</span> <span class='id identifier rubyid_height'>height</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
|
963
|
+
<span class='kw'>end</span></pre>
|
964
|
+
</td>
|
965
|
+
</tr>
|
966
|
+
</table>
|
967
|
+
</div>
|
968
|
+
|
969
|
+
</div>
|
970
|
+
|
971
|
+
<div id="instance_method_details" class="method_details_list">
|
972
|
+
<h2>Instance Method Details</h2>
|
973
|
+
|
974
|
+
|
975
|
+
<div class="method_details first">
|
976
|
+
<h3 class="signature first" id="destroy-instance_method">
|
977
|
+
|
978
|
+
#<strong>destroy</strong> ⇒ <tt>Object</tt>
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
|
983
|
+
|
984
|
+
</h3><table class="source_code">
|
985
|
+
<tr>
|
986
|
+
<td>
|
987
|
+
<pre class="lines">
|
988
|
+
|
989
|
+
|
990
|
+
37
|
991
|
+
38
|
992
|
+
39</pre>
|
993
|
+
</td>
|
994
|
+
<td>
|
995
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 37</span>
|
996
|
+
|
997
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_destroy'>destroy</span>
|
998
|
+
<span class='const'><span class='object_link'><a href="Global.html" title="Global (module)">Global</a></span></span><span class='period'>.</span><span class='id identifier rubyid_shapes'><span class='object_link'><a href="Global.html#shapes-class_method" title="Global.shapes (method)">shapes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
999
|
+
<span class='kw'>end</span></pre>
|
1000
|
+
</td>
|
1001
|
+
</tr>
|
1002
|
+
</table>
|
1003
|
+
</div>
|
1004
|
+
|
1005
|
+
<div class="method_details ">
|
1006
|
+
<h3 class="signature " id="draw-instance_method">
|
1007
|
+
|
1008
|
+
#<strong>draw</strong> ⇒ <tt>Object</tt>
|
1009
|
+
|
1010
|
+
|
1011
|
+
|
1012
|
+
|
1013
|
+
|
1014
|
+
</h3><table class="source_code">
|
1015
|
+
<tr>
|
1016
|
+
<td>
|
1017
|
+
<pre class="lines">
|
1018
|
+
|
1019
|
+
|
1020
|
+
28
|
1021
|
+
29
|
1022
|
+
30
|
1023
|
+
31
|
1024
|
+
32
|
1025
|
+
33
|
1026
|
+
34
|
1027
|
+
35</pre>
|
1028
|
+
</td>
|
1029
|
+
<td>
|
1030
|
+
<pre class="code"><span class="info file"># File 'lib/fantasy/shape.rb', line 28</span>
|
1031
|
+
|
1032
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_draw'>draw</span>
|
1033
|
+
<span class='kw'>case</span> <span class='ivar'>@kind</span>
|
1034
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>rectangle</span><span class='tstring_end'>"</span></span>
|
1035
|
+
<span class='id identifier rubyid_draw_rectangle'>draw_rectangle</span>
|
1036
|
+
<span class='kw'>else</span>
|
1037
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Shape.kind not supported: '</span><span class='embexpr_beg'>#{</span><span class='ivar'>@kind</span><span class='embexpr_end'>}</span><span class='tstring_content'>'. Supported kinds: 'rectangle'</span><span class='tstring_end'>"</span></span>
|
1038
|
+
<span class='kw'>end</span>
|
1039
|
+
<span class='kw'>end</span></pre>
|
1040
|
+
</td>
|
1041
|
+
</tr>
|
1042
|
+
</table>
|
1043
|
+
</div>
|
1044
|
+
|
1045
|
+
</div>
|
1046
|
+
|
1047
|
+
</div>
|
1048
|
+
|
1049
|
+
<div id="footer">
|
1050
|
+
Generated on Sat Apr 2 14:24:12 2022 by
|
1051
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1052
|
+
0.9.27 (ruby-3.0.2).
|
1053
|
+
</div>
|
1054
|
+
|
1055
|
+
</div>
|
1056
|
+
</body>
|
1057
|
+
</html>
|