gosu 0.7.13.3-x86-mswin32-60 → 0.7.14-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/README.txt +5 -5
  2. data/examples/media/Starfighter.bmp +0 -0
  3. data/lib/fmod.dll +0 -0
  4. data/lib/gosu.for_1_8.so +0 -0
  5. data/lib/gosu.for_1_9.so +0 -0
  6. data/lib/gosu.rb +8 -4
  7. data/reference/rdoc/classes/Gosu.html +1547 -0
  8. data/reference/rdoc/classes/Gosu/Color.html +563 -0
  9. data/reference/rdoc/classes/Gosu/Font.html +538 -0
  10. data/reference/rdoc/classes/Gosu/GLTexInfo.html +404 -0
  11. data/reference/rdoc/classes/Gosu/Image.html +702 -0
  12. data/reference/rdoc/classes/Gosu/Sample.html +469 -0
  13. data/reference/rdoc/classes/Gosu/SampleInstance.html +516 -0
  14. data/reference/rdoc/classes/Gosu/Song.html +561 -0
  15. data/reference/rdoc/classes/Gosu/TextInput.html +398 -0
  16. data/reference/rdoc/classes/Gosu/Window.html +913 -0
  17. data/reference/rdoc/classes/Numeric.html +416 -0
  18. data/reference/rdoc/created.rid +1 -0
  19. data/reference/rdoc/files/COPYING_txt.html +386 -0
  20. data/reference/rdoc/files/README_txt.html +381 -0
  21. data/reference/rdoc/files/reference/DeploymentOnOSX_rdoc.html +390 -0
  22. data/reference/rdoc/files/reference/DeploymentOnWindows_rdoc.html +392 -0
  23. data/reference/rdoc/files/reference/DrawingWithColors_rdoc.html +357 -0
  24. data/reference/rdoc/files/reference/OrderOfCorners_rdoc.html +352 -0
  25. data/reference/rdoc/files/reference/Tileability_rdoc.html +368 -0
  26. data/reference/rdoc/files/reference/ZOrdering_rdoc.html +355 -0
  27. data/reference/rdoc/files/reference/gosu_rb.html +342 -0
  28. data/reference/rdoc/fr_class_index.html +12 -0
  29. data/reference/rdoc/fr_file_index.html +10 -0
  30. data/reference/rdoc/fr_method_index.html +63 -0
  31. data/reference/rdoc/index.html +1 -0
  32. data/reference/rdoc/rdoc-style.css +318 -0
  33. metadata +28 -2
@@ -0,0 +1,398 @@
1
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Class: Gosu::TextInput</title><link type="text/css" href="../.././rdoc-style.css" media="screen" rel="stylesheet"/><script type="text/javascript">
2
+ // Allison template
3
+ // Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.
4
+
5
+ var href_base = '../.././rdoc-style.css'.replace(/(.*\/).*/, '$1'); // inline js is good for something
6
+
7
+ function $(id) {
8
+ if (document.getElementById)
9
+ elem = document.getElementById(id);
10
+ else if ( document.all )
11
+ elem = eval("document.all." + id);
12
+ else
13
+ return false;
14
+ return elem;
15
+ }
16
+
17
+ function toggle(id) {
18
+ elem = $(id);
19
+ elemStyle = elem.style;
20
+ if (elemStyle.display == "block") {
21
+ elemStyle.display = "none"
22
+ } else {
23
+ elemStyle.display = "block"
24
+ }
25
+ return true;
26
+ }
27
+
28
+ function toggleText(id) {
29
+ elem = $(id)
30
+ if (m = elem.innerHTML.match(/(Hide)(.*)/)) {
31
+ elem.innerHTML = "Show" + m[2];
32
+ } else if (m = elem.innerHTML.match(/(Show)(.*)/)) {
33
+ elem.innerHTML = "Hide" + m[2];
34
+ }
35
+ return true;
36
+ }
37
+
38
+ function span(s, klass) {
39
+ return '<span class="' + klass + '">' + s + '</span>';
40
+ }
41
+
42
+ function highlightSymbols() {
43
+ pres = document.getElementsByTagName('pre');
44
+ for(var i = 0; i < pres.length; i++) {
45
+ pre = pres[i];
46
+ spans = pre.getElementsByTagName('span');
47
+ for(var k = 0; k < spans.length; k++) {
48
+ span = spans[k];
49
+ if (span.className.match(/ruby-identifier/)) {
50
+ if (span.innerHTML.match(/^:/)) {
51
+ span.className += " ruby-symbol";
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ function hasClass(obj) {
59
+ var result = false;
60
+ if (obj.getAttributeNode("class") != null) {
61
+ result = obj.getAttributeNode("class").value;
62
+ }
63
+ return result;
64
+ }
65
+
66
+ function stripe() {
67
+ var even = true;
68
+ var color = "#e4ebed";
69
+ var tables = document.getElementsByTagName('table');
70
+ if (tables.length == 0) { return; }
71
+ for (var h = 0; h < tables.length; h++) {
72
+ var trs = tables[h].getElementsByTagName("tr");
73
+ for (var i = 0; i < trs.length; i++) {
74
+ var tds = trs[i].getElementsByTagName("td");
75
+ for (var j = 0; j < tds.length; j++) {
76
+ if (hasClass(tds[j]) != "first") {
77
+ var mytd = tds[j];
78
+ if (even) {
79
+ mytd.style.backgroundColor = color;
80
+ }
81
+ }
82
+ }
83
+ even = ! even;
84
+ }
85
+ }
86
+ }
87
+
88
+ function ajaxGet(url) {
89
+ url = (href_base + url).replace('/./', '/')
90
+ var req = false;
91
+
92
+ if (window.ActiveXObject) {
93
+ try {
94
+ // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object
95
+ // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die.
96
+ req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
97
+ } catch (e) {
98
+ try {
99
+ /* IE 6 and maybe 5, don't know, don't care */
100
+ req = new ActiveXObject("Msxml2.XMLHTTP");
101
+ } catch (e) {
102
+ try {
103
+ req = new ActiveXObject("Microsoft.XMLHTTP");
104
+ } catch (e) {
105
+ req = false;
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ /* real browsers */
112
+ if (!req && window.XMLHttpRequest) {
113
+ try {
114
+ req = new XMLHttpRequest();
115
+ } catch (e) {
116
+ req = false;
117
+ }
118
+ }
119
+
120
+ if (req) {
121
+ req.open('GET', url, false);
122
+ req.send(null);
123
+ return req.responseText;
124
+ } else {
125
+ return "Ajax error";
126
+ }
127
+ }
128
+
129
+
130
+ function addEvent(elm, evType, fn, useCapture) {
131
+ if (elm.addEventListener) {
132
+ elm.addEventListener(evType, fn, useCapture);
133
+ return true;
134
+ } else if (elm.attachEvent) {
135
+ var r = elm.attachEvent('on' + evType, fn);
136
+ return r;
137
+ } else {
138
+ elm['on' + evType] = fn;
139
+ }
140
+ }
141
+
142
+ function insertIndices() {
143
+ pages = ["class", "file", "method"]
144
+ for (x in pages) {
145
+ $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base);
146
+ }
147
+ /* mouseoverify method links */
148
+ links = $('method').getElementsByTagName('a');
149
+ for (var x = 0; x < links.length; x++) {
150
+ if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) {
151
+ links[x].innerHTML = m[1] + '<br>';
152
+ links[x].title = m[2];
153
+ }
154
+ }
155
+ /* this is stupid */
156
+ $('class').style.display = "block";
157
+ $('file').style.display = "block";
158
+
159
+ /* has to be here because IE7 does not guarantee the onLoad callback order */
160
+ abbreviateIndicesInner(["class", "file"], 25, "a");
161
+ /* same, linkTitle() depends on the class link list */
162
+ linkTitle();
163
+ }
164
+
165
+ function abbreviateIndices() {
166
+ var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"];
167
+ abbreviateIndicesInner(ids, 25, 'a');
168
+ abbreviateIndicesInner(ids, 25, 'span');
169
+ }
170
+
171
+ function abbreviateIndicesInner(indices, amount, tag) {
172
+ for (var x = 0; x < indices.length; x++) {
173
+ var the_index = $(indices[x]);
174
+ if (the_index) {
175
+ links = the_index.getElementsByTagName(tag);
176
+ for (var y = 0; y < links.length; y++) {
177
+ var link = links[y];
178
+ if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) {
179
+ // avoid nesting
180
+ link.innerHTML = link.innerHTML.replace(/<br>|\n/gi, '');
181
+ link.title = link.innerHTML;
182
+ link.innerHTML = abbreviate(link.innerHTML, amount) + '<br>';
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ function linkTitle() {
190
+
191
+ /* grab the correct title element from the index */
192
+ var index_page = ajaxGet('index.html');
193
+ title_text = index_page.match(/<title>(.*)<\/title>/m)[1];
194
+ document.title = title_text + " - " + document.title;
195
+ var p = $('header').getElementsByTagName('p')[0]
196
+ if (p.innerHTML.match(/^\s*$/)) {
197
+ p.innerHTML = title_text;
198
+ } else {
199
+ p.innerHTML = title_text + ": " + p.innerHTML;
200
+ }
201
+
202
+ /* set the link properly */
203
+ title_link = index_page.match(/<a\s+href="(.*?)"/)[1];
204
+ var element = $('title');
205
+ var item_type = "";
206
+ var item_name = "";
207
+ if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) {
208
+ item_type = m[1];
209
+ item_name = m[2];
210
+ } else {
211
+ item_name = element.innerHTML;
212
+ }
213
+ element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>';
214
+ element.getElementsByTagName('a')[0].title = item_name
215
+
216
+ /* breadcrumb navigation */
217
+ items = item_name.split("::");
218
+ items_new = item_name.split("::");
219
+ file_links = $('class').getElementsByTagName('a');
220
+ for (var x = 0; x < items.length - 1; x++ ){
221
+ var item = items[x];
222
+ link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/');
223
+ regex = new RegExp(RegExp.escape(link) + '$');
224
+ for (var y = 0; y < file_links.length; y++) {
225
+ if (file_links[y].href.match(regex)) {
226
+ items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>';
227
+ break;
228
+ }
229
+ }
230
+ }
231
+ $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: ");
232
+ }
233
+
234
+ function abbreviate(s, size) {
235
+ while (s.length > size) {
236
+ var old_s = s;
237
+ s = s.replace(/\s|\n/mg, '');
238
+ s = s.replace(/([A-Z])[a-z]+/m, '$1');
239
+ if (!s || old_s == s) {
240
+ return "..." + s.substring(s.length - size, s.length);
241
+ }
242
+ }
243
+ return s;
244
+ }
245
+
246
+ function disableSubmit(event) {
247
+ var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
248
+ if (keyCode == 13) {
249
+ return false;
250
+ } else {
251
+ return true;
252
+ }
253
+ }
254
+
255
+ function filterList(id, s, event) {
256
+
257
+ /* some weak escaping */
258
+ s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, '');
259
+ s = RegExp.escape(s);
260
+
261
+ var show_all = false;
262
+ if (s.match(/^\s*$/)) {
263
+ show_all = true;
264
+ }
265
+
266
+ links = $(id).getElementsByTagName('a')
267
+ regex = new RegExp(s, 'i');
268
+
269
+ for (var x = 0; x < links.length; x++) {
270
+ var link = links[x];
271
+ if (show_all) {
272
+ link.style.display = 'inline';
273
+ } else {
274
+ if (link.innerHTML.match(regex)) {
275
+ link.style.display = 'inline';
276
+ } else {
277
+ link.style.display = 'none';
278
+ }
279
+ }
280
+ }
281
+ return true;
282
+ }
283
+
284
+ RegExp.escape = function(text) {
285
+ if (!arguments.callee.sRE) {
286
+ var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
287
+ arguments.callee.sRE = new RegExp(
288
+ '(\\' + specials.join('|\\') + ')', 'g'
289
+ );
290
+ }
291
+ return text.replace(arguments.callee.sRE, '\\$1');
292
+ }
293
+
294
+ function hacks() {
295
+ // show the spacer if necessary,
296
+ divs = document.getElementsByTagName('div');
297
+ for(var x = 0; x < divs.length; x++) {
298
+ if (divs[x].className && divs[x].className.match(/top/)) {
299
+ document.getElementById('spacer').style.display = 'block';
300
+ }
301
+ }
302
+ // remove extra colons from tables
303
+ tds = document.getElementsByTagName('td');
304
+ for(var x = 0; x < tds.length; x++) {
305
+ str = tds[x].innerHTML
306
+ if (str.charAt(str.length - 1) == ":") {
307
+ tds[x].innerHTML = str.slice(0, str.length - 1)
308
+ }
309
+ }
310
+ }
311
+
312
+ addEvent(window, 'load', insertIndices, false);
313
+ addEvent(window, 'load', abbreviateIndices, false);
314
+ addEvent(window, 'load', stripe, false);
315
+ addEvent(window, 'load', highlightSymbols, false);
316
+ addEvent(window, 'load', hacks, false);
317
+ </script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p>
318
+ </p><span><h1 id="title">
319
+ Class: Gosu::TextInput
320
+ </h1></span>
321
+ </div><div class="clear"></div><div id="left">
322
+ <div class="navigation darker top" id="child_of"><h3>Child of</h3><span>
323
+
324
+ Object
325
+ </span></div>
326
+
327
+ <div class="navigation darker top" id="defined_in"><h3>Defined in</h3>
328
+
329
+ <a href="../../files/reference/gosu_rb.html">reference/gosu.rb</a>
330
+
331
+ </div>
332
+
333
+
334
+
335
+ <div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content">
336
+ <h1 id="item_name">Class: Gosu::TextInput</h1>
337
+
338
+ <div id="description"><p>
339
+ <a href="TextInput.html">TextInput</a> instances are invisible objects that
340
+ build a text string from input, using the current operating system&#8216;s
341
+ keyboard layout.
342
+ </p>
343
+ <p>
344
+ At its most basic form, you only need to create a new <a
345
+ href="TextInput.html">TextInput</a> instance and pass it to your window via
346
+ text_input=. Until you call this function again, passing nil, the <a
347
+ href="TextInput.html">TextInput</a> object will build a text that can be
348
+ accessed via TextInput#text.
349
+ </p>
350
+ <p>
351
+ A <a href="TextInput.html">TextInput</a> object is purely abstract, though;
352
+ drawing the input field is left to the user. As with most of <a
353
+ href="../Gosu.html">Gosu</a>, how this is handled is completely left open.
354
+ </p>
355
+ <p>
356
+ <a href="TextInput.html">TextInput</a> only aims to provide enough code for
357
+ your own GUIs to build upon.
358
+ </p>
359
+ </div>
360
+
361
+
362
+
363
+
364
+ <p></p>
365
+
366
+
367
+
368
+
369
+ <h1>Attributes</h1><p><table><tr><th>Name</th><th>Read/write?</th></tr>
370
+ <tr>
371
+ <td class="highlight">caret_pos</td>
372
+
373
+
374
+
375
+
376
+ <td class="normal">R</td>
377
+ </tr>
378
+ <tr>
379
+ <td class="highlight">selection_start</td>
380
+
381
+
382
+
383
+
384
+ <td class="normal">R</td>
385
+ </tr>
386
+ <tr>
387
+ <td class="highlight">text</td>
388
+
389
+
390
+
391
+
392
+ <td class="normal">RW</td>
393
+ </tr>
394
+ </table></p>
395
+
396
+
397
+
398
+ </div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>
@@ -0,0 +1,913 @@
1
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Class: Gosu::Window</title><link type="text/css" href="../.././rdoc-style.css" media="screen" rel="stylesheet"/><script type="text/javascript">
2
+ // Allison template
3
+ // Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.
4
+
5
+ var href_base = '../.././rdoc-style.css'.replace(/(.*\/).*/, '$1'); // inline js is good for something
6
+
7
+ function $(id) {
8
+ if (document.getElementById)
9
+ elem = document.getElementById(id);
10
+ else if ( document.all )
11
+ elem = eval("document.all." + id);
12
+ else
13
+ return false;
14
+ return elem;
15
+ }
16
+
17
+ function toggle(id) {
18
+ elem = $(id);
19
+ elemStyle = elem.style;
20
+ if (elemStyle.display == "block") {
21
+ elemStyle.display = "none"
22
+ } else {
23
+ elemStyle.display = "block"
24
+ }
25
+ return true;
26
+ }
27
+
28
+ function toggleText(id) {
29
+ elem = $(id)
30
+ if (m = elem.innerHTML.match(/(Hide)(.*)/)) {
31
+ elem.innerHTML = "Show" + m[2];
32
+ } else if (m = elem.innerHTML.match(/(Show)(.*)/)) {
33
+ elem.innerHTML = "Hide" + m[2];
34
+ }
35
+ return true;
36
+ }
37
+
38
+ function span(s, klass) {
39
+ return '<span class="' + klass + '">' + s + '</span>';
40
+ }
41
+
42
+ function highlightSymbols() {
43
+ pres = document.getElementsByTagName('pre');
44
+ for(var i = 0; i < pres.length; i++) {
45
+ pre = pres[i];
46
+ spans = pre.getElementsByTagName('span');
47
+ for(var k = 0; k < spans.length; k++) {
48
+ span = spans[k];
49
+ if (span.className.match(/ruby-identifier/)) {
50
+ if (span.innerHTML.match(/^:/)) {
51
+ span.className += " ruby-symbol";
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ function hasClass(obj) {
59
+ var result = false;
60
+ if (obj.getAttributeNode("class") != null) {
61
+ result = obj.getAttributeNode("class").value;
62
+ }
63
+ return result;
64
+ }
65
+
66
+ function stripe() {
67
+ var even = true;
68
+ var color = "#e4ebed";
69
+ var tables = document.getElementsByTagName('table');
70
+ if (tables.length == 0) { return; }
71
+ for (var h = 0; h < tables.length; h++) {
72
+ var trs = tables[h].getElementsByTagName("tr");
73
+ for (var i = 0; i < trs.length; i++) {
74
+ var tds = trs[i].getElementsByTagName("td");
75
+ for (var j = 0; j < tds.length; j++) {
76
+ if (hasClass(tds[j]) != "first") {
77
+ var mytd = tds[j];
78
+ if (even) {
79
+ mytd.style.backgroundColor = color;
80
+ }
81
+ }
82
+ }
83
+ even = ! even;
84
+ }
85
+ }
86
+ }
87
+
88
+ function ajaxGet(url) {
89
+ url = (href_base + url).replace('/./', '/')
90
+ var req = false;
91
+
92
+ if (window.ActiveXObject) {
93
+ try {
94
+ // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object
95
+ // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die.
96
+ req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
97
+ } catch (e) {
98
+ try {
99
+ /* IE 6 and maybe 5, don't know, don't care */
100
+ req = new ActiveXObject("Msxml2.XMLHTTP");
101
+ } catch (e) {
102
+ try {
103
+ req = new ActiveXObject("Microsoft.XMLHTTP");
104
+ } catch (e) {
105
+ req = false;
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ /* real browsers */
112
+ if (!req && window.XMLHttpRequest) {
113
+ try {
114
+ req = new XMLHttpRequest();
115
+ } catch (e) {
116
+ req = false;
117
+ }
118
+ }
119
+
120
+ if (req) {
121
+ req.open('GET', url, false);
122
+ req.send(null);
123
+ return req.responseText;
124
+ } else {
125
+ return "Ajax error";
126
+ }
127
+ }
128
+
129
+
130
+ function addEvent(elm, evType, fn, useCapture) {
131
+ if (elm.addEventListener) {
132
+ elm.addEventListener(evType, fn, useCapture);
133
+ return true;
134
+ } else if (elm.attachEvent) {
135
+ var r = elm.attachEvent('on' + evType, fn);
136
+ return r;
137
+ } else {
138
+ elm['on' + evType] = fn;
139
+ }
140
+ }
141
+
142
+ function insertIndices() {
143
+ pages = ["class", "file", "method"]
144
+ for (x in pages) {
145
+ $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base);
146
+ }
147
+ /* mouseoverify method links */
148
+ links = $('method').getElementsByTagName('a');
149
+ for (var x = 0; x < links.length; x++) {
150
+ if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) {
151
+ links[x].innerHTML = m[1] + '<br>';
152
+ links[x].title = m[2];
153
+ }
154
+ }
155
+ /* this is stupid */
156
+ $('class').style.display = "block";
157
+ $('file').style.display = "block";
158
+
159
+ /* has to be here because IE7 does not guarantee the onLoad callback order */
160
+ abbreviateIndicesInner(["class", "file"], 25, "a");
161
+ /* same, linkTitle() depends on the class link list */
162
+ linkTitle();
163
+ }
164
+
165
+ function abbreviateIndices() {
166
+ var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"];
167
+ abbreviateIndicesInner(ids, 25, 'a');
168
+ abbreviateIndicesInner(ids, 25, 'span');
169
+ }
170
+
171
+ function abbreviateIndicesInner(indices, amount, tag) {
172
+ for (var x = 0; x < indices.length; x++) {
173
+ var the_index = $(indices[x]);
174
+ if (the_index) {
175
+ links = the_index.getElementsByTagName(tag);
176
+ for (var y = 0; y < links.length; y++) {
177
+ var link = links[y];
178
+ if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) {
179
+ // avoid nesting
180
+ link.innerHTML = link.innerHTML.replace(/<br>|\n/gi, '');
181
+ link.title = link.innerHTML;
182
+ link.innerHTML = abbreviate(link.innerHTML, amount) + '<br>';
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ function linkTitle() {
190
+
191
+ /* grab the correct title element from the index */
192
+ var index_page = ajaxGet('index.html');
193
+ title_text = index_page.match(/<title>(.*)<\/title>/m)[1];
194
+ document.title = title_text + " - " + document.title;
195
+ var p = $('header').getElementsByTagName('p')[0]
196
+ if (p.innerHTML.match(/^\s*$/)) {
197
+ p.innerHTML = title_text;
198
+ } else {
199
+ p.innerHTML = title_text + ": " + p.innerHTML;
200
+ }
201
+
202
+ /* set the link properly */
203
+ title_link = index_page.match(/<a\s+href="(.*?)"/)[1];
204
+ var element = $('title');
205
+ var item_type = "";
206
+ var item_name = "";
207
+ if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) {
208
+ item_type = m[1];
209
+ item_name = m[2];
210
+ } else {
211
+ item_name = element.innerHTML;
212
+ }
213
+ element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>';
214
+ element.getElementsByTagName('a')[0].title = item_name
215
+
216
+ /* breadcrumb navigation */
217
+ items = item_name.split("::");
218
+ items_new = item_name.split("::");
219
+ file_links = $('class').getElementsByTagName('a');
220
+ for (var x = 0; x < items.length - 1; x++ ){
221
+ var item = items[x];
222
+ link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/');
223
+ regex = new RegExp(RegExp.escape(link) + '$');
224
+ for (var y = 0; y < file_links.length; y++) {
225
+ if (file_links[y].href.match(regex)) {
226
+ items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>';
227
+ break;
228
+ }
229
+ }
230
+ }
231
+ $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: ");
232
+ }
233
+
234
+ function abbreviate(s, size) {
235
+ while (s.length > size) {
236
+ var old_s = s;
237
+ s = s.replace(/\s|\n/mg, '');
238
+ s = s.replace(/([A-Z])[a-z]+/m, '$1');
239
+ if (!s || old_s == s) {
240
+ return "..." + s.substring(s.length - size, s.length);
241
+ }
242
+ }
243
+ return s;
244
+ }
245
+
246
+ function disableSubmit(event) {
247
+ var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
248
+ if (keyCode == 13) {
249
+ return false;
250
+ } else {
251
+ return true;
252
+ }
253
+ }
254
+
255
+ function filterList(id, s, event) {
256
+
257
+ /* some weak escaping */
258
+ s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, '');
259
+ s = RegExp.escape(s);
260
+
261
+ var show_all = false;
262
+ if (s.match(/^\s*$/)) {
263
+ show_all = true;
264
+ }
265
+
266
+ links = $(id).getElementsByTagName('a')
267
+ regex = new RegExp(s, 'i');
268
+
269
+ for (var x = 0; x < links.length; x++) {
270
+ var link = links[x];
271
+ if (show_all) {
272
+ link.style.display = 'inline';
273
+ } else {
274
+ if (link.innerHTML.match(regex)) {
275
+ link.style.display = 'inline';
276
+ } else {
277
+ link.style.display = 'none';
278
+ }
279
+ }
280
+ }
281
+ return true;
282
+ }
283
+
284
+ RegExp.escape = function(text) {
285
+ if (!arguments.callee.sRE) {
286
+ var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
287
+ arguments.callee.sRE = new RegExp(
288
+ '(\\' + specials.join('|\\') + ')', 'g'
289
+ );
290
+ }
291
+ return text.replace(arguments.callee.sRE, '\\$1');
292
+ }
293
+
294
+ function hacks() {
295
+ // show the spacer if necessary,
296
+ divs = document.getElementsByTagName('div');
297
+ for(var x = 0; x < divs.length; x++) {
298
+ if (divs[x].className && divs[x].className.match(/top/)) {
299
+ document.getElementById('spacer').style.display = 'block';
300
+ }
301
+ }
302
+ // remove extra colons from tables
303
+ tds = document.getElementsByTagName('td');
304
+ for(var x = 0; x < tds.length; x++) {
305
+ str = tds[x].innerHTML
306
+ if (str.charAt(str.length - 1) == ":") {
307
+ tds[x].innerHTML = str.slice(0, str.length - 1)
308
+ }
309
+ }
310
+ }
311
+
312
+ addEvent(window, 'load', insertIndices, false);
313
+ addEvent(window, 'load', abbreviateIndices, false);
314
+ addEvent(window, 'load', stripe, false);
315
+ addEvent(window, 'load', highlightSymbols, false);
316
+ addEvent(window, 'load', hacks, false);
317
+ </script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p>
318
+ </p><span><h1 id="title">
319
+ Class: Gosu::Window
320
+ </h1></span>
321
+ </div><div class="clear"></div><div id="left">
322
+ <div class="navigation darker top" id="child_of"><h3>Child of</h3><span>
323
+
324
+ Object
325
+ </span></div>
326
+
327
+ <div class="navigation darker top" id="defined_in"><h3>Defined in</h3>
328
+
329
+ <a href="../../files/reference/gosu_rb.html">reference/gosu.rb</a>
330
+
331
+ </div>
332
+
333
+
334
+
335
+ <div class="navigation top" id="methods"><h3>Methods</h3>
336
+
337
+
338
+ <a href='#M000041'>
339
+ button_down<br/>
340
+ </a>
341
+
342
+
343
+
344
+
345
+ <a href='#M000046'>
346
+ button_down?<br/>
347
+ </a>
348
+
349
+
350
+
351
+
352
+ <a href='#M000047'>
353
+ button_id_to_char<br/>
354
+ </a>
355
+
356
+
357
+
358
+
359
+ <a href='#M000042'>
360
+ button_up<br/>
361
+ </a>
362
+
363
+
364
+
365
+
366
+ <a href='#M000048'>
367
+ char_to_button_id<br/>
368
+ </a>
369
+
370
+
371
+
372
+
373
+ <a href='#M000050'>
374
+ clip_to<br/>
375
+ </a>
376
+
377
+
378
+
379
+
380
+ <a href='#M000036'>
381
+ close<br/>
382
+ </a>
383
+
384
+
385
+
386
+
387
+ <a href='#M000038'>
388
+ draw<br/>
389
+ </a>
390
+
391
+
392
+
393
+
394
+ <a href='#M000043'>
395
+ draw_line<br/>
396
+ </a>
397
+
398
+
399
+
400
+
401
+ <a href='#M000045'>
402
+ draw_quad<br/>
403
+ </a>
404
+
405
+
406
+
407
+
408
+ <a href='#M000044'>
409
+ draw_triangle<br/>
410
+ </a>
411
+
412
+
413
+
414
+
415
+ <a href='#M000049'>
416
+ gl<br/>
417
+ </a>
418
+
419
+
420
+
421
+
422
+ <a href='#M000039'>
423
+ needs_redraw?<br/>
424
+ </a>
425
+
426
+
427
+
428
+
429
+ <a href='#M000034'>
430
+ new<br/>
431
+ </a>
432
+
433
+
434
+
435
+
436
+ <a href='#M000040'>
437
+ set_mouse_position<br/>
438
+ </a>
439
+
440
+
441
+
442
+
443
+ <a href='#M000035'>
444
+ show<br/>
445
+ </a>
446
+
447
+
448
+
449
+
450
+ <a href='#M000037'>
451
+ update<br/>
452
+ </a>
453
+
454
+
455
+ </div>
456
+ <div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content">
457
+ <h1 id="item_name">Class: Gosu::Window</h1>
458
+
459
+ <div id="description"><p>
460
+ Main class that serves as the foundation of a standard <a
461
+ href="../Gosu.html">Gosu</a> application. Manages initialization of all of
462
+ <a href="../Gosu.html">Gosu</a>&#8216;s core components and provides timing
463
+ functionality.
464
+ </p>
465
+ <p>
466
+ Note that all coordinates, even the mouse position, are in client
467
+ coordinates relative to the window. This means that the mouse position can
468
+ be negative or larger than the window size.
469
+ </p>
470
+ <p>
471
+ Note that you should really only use on instance of this class at the same
472
+ time. This may or may not change later.
473
+ </p>
474
+ <p>
475
+ Right now, having two or more windows and loading samples or songs on both
476
+ of them will result in an exception. If you want to re-open your game
477
+ window, make sure the old one is really dead, e.g. by poking the garbage
478
+ collector.
479
+ </p>
480
+ </div>
481
+
482
+
483
+
484
+
485
+ <p></p>
486
+
487
+
488
+
489
+
490
+ <h1>Attributes</h1><p><table><tr><th>Name</th><th>Read/write?</th></tr>
491
+ <tr>
492
+ <td class="highlight">caption</td>
493
+
494
+
495
+
496
+
497
+ <td class="normal">RW</td>
498
+ </tr>
499
+ <tr>
500
+ <td class="highlight">height</td>
501
+
502
+
503
+
504
+
505
+ <td class="normal">R</td>
506
+ </tr>
507
+ <tr>
508
+ <td class="highlight">mouse_x</td>
509
+
510
+
511
+
512
+
513
+ <td class="normal">RW</td>
514
+ </tr>
515
+ <tr>
516
+ <td class="highlight">mouse_y</td>
517
+
518
+
519
+
520
+
521
+ <td class="normal">RW</td>
522
+ </tr>
523
+ <tr>
524
+ <td class="highlight">text_input</td>
525
+
526
+
527
+
528
+
529
+ <td class="normal">RW</td>
530
+ </tr>
531
+ <tr>
532
+ <td class="highlight">update_interval</td>
533
+
534
+
535
+
536
+
537
+ <td class="normal">R</td>
538
+ </tr>
539
+ <tr>
540
+ <td class="highlight">update_interval</td>
541
+
542
+
543
+
544
+
545
+ <td class="normal">R</td>
546
+ </tr>
547
+ <tr>
548
+ <td class="highlight">width</td>
549
+
550
+
551
+
552
+
553
+ <td class="normal">R</td>
554
+ </tr>
555
+ </table></p>
556
+
557
+
558
+ <h1>Public Class Methods</h1>
559
+
560
+
561
+ <a class="small" name="M000047"><br/></a>
562
+ <div class="method_block"><h3>
563
+ <a href='#M000047'>
564
+
565
+
566
+ button_id_to_char
567
+
568
+ (id)
569
+
570
+ </a>
571
+ </h3>
572
+ <p>
573
+ DEPRECATED: Returns the character a button usually produces, or nil.
574
+ </p>
575
+
576
+ <p class="source_link" id="M000047-show-link"><a onclick="toggle('M000047-source'); toggleText('M000047-link'); return false;" href="#" id="M000047-link">Show source...</a></p><div class="source" id="M000047-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 408</span>
577
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">button_id_to_char</span>(<span class="ruby-identifier">id</span>); <span class="ruby-keyword kw">end</span></pre></div>
578
+ </div>
579
+
580
+ <a class="small" name="M000048"><br/></a>
581
+ <div class="method_block"><h3>
582
+ <a href='#M000048'>
583
+
584
+
585
+ char_to_button_id
586
+
587
+ (char)
588
+
589
+ </a>
590
+ </h3>
591
+ <p>
592
+ DEPRECATED: Returns the button that has to be pressed to produce the given
593
+ character, or nil.
594
+ </p>
595
+
596
+ <p class="source_link" id="M000048-show-link"><a onclick="toggle('M000048-source'); toggleText('M000048-link'); return false;" href="#" id="M000048-link">Show source...</a></p><div class="source" id="M000048-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 412</span>
597
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">char_to_button_id</span>(<span class="ruby-identifier">char</span>); <span class="ruby-keyword kw">end</span></pre></div>
598
+ </div>
599
+
600
+ <a class="small" name="M000034"><br/></a>
601
+ <div class="method_block"><h3>
602
+ <a href='#M000034'>
603
+
604
+
605
+ new
606
+
607
+ (width, height, fullscreen, update_interval = 16.666666)
608
+
609
+ </a>
610
+ </h3>
611
+ <table>
612
+ <tr><td valign="top">update_interval:</td><td>Interval in milliseconds between two calls
613
+
614
+ </td></tr>
615
+ </table>
616
+ <p>
617
+ to the <a href="Window.html#M000037">update</a> member function. The
618
+ default means the game will run at 60 FPS, which is ideal on standard 60 Hz
619
+ TFT screens.
620
+ </p>
621
+
622
+ <p class="source_link" id="M000034-show-link"><a onclick="toggle('M000034-source'); toggleText('M000034-link'); return false;" href="#" id="M000034-link">Show source...</a></p><div class="source" id="M000034-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 361</span>
623
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>, <span class="ruby-identifier">fullscreen</span>, <span class="ruby-identifier">update_interval</span> = <span class="ruby-value">16.666666</span>); <span class="ruby-keyword kw">end</span></pre></div>
624
+ </div>
625
+
626
+
627
+ <h1>Public Instance Methods</h1>
628
+
629
+
630
+ <a class="small" name="M000041"><br/></a>
631
+ <div class="method_block"><h3>
632
+ <a href='#M000041'>
633
+
634
+
635
+ button_down
636
+
637
+ (id)
638
+
639
+ </a>
640
+ </h3>
641
+ <p>
642
+ Called before <a href="Window.html#M000037">update</a> when the user
643
+ pressed a button while the window had the focus.
644
+ </p>
645
+
646
+ <p class="source_link" id="M000041-show-link"><a onclick="toggle('M000041-source'); toggleText('M000041-link'); return false;" href="#" id="M000041-link">Show source...</a></p><div class="source" id="M000041-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 390</span>
647
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">button_down</span>(<span class="ruby-identifier">id</span>); <span class="ruby-keyword kw">end</span></pre></div>
648
+ </div>
649
+
650
+ <a class="small" name="M000046"><br/></a>
651
+ <div class="method_block"><h3>
652
+ <a href='#M000046'>
653
+
654
+
655
+ button_down?
656
+
657
+ (id)
658
+
659
+ </a>
660
+ </h3>
661
+ <p>
662
+ Returns true if a button is currently pressed. Updated every tick.
663
+ </p>
664
+
665
+ <p class="source_link" id="M000046-show-link"><a onclick="toggle('M000046-source'); toggleText('M000046-link'); return false;" href="#" id="M000046-link">Show source...</a></p><div class="source" id="M000046-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 405</span>
666
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">button_down?</span>(<span class="ruby-identifier">id</span>); <span class="ruby-keyword kw">end</span></pre></div>
667
+ </div>
668
+
669
+ <a class="small" name="M000042"><br/></a>
670
+ <div class="method_block"><h3>
671
+ <a href='#M000042'>
672
+
673
+
674
+ button_up
675
+
676
+ (id)
677
+
678
+ </a>
679
+ </h3>
680
+ <p>
681
+ Same as buttonDown. Called then the user released a button.
682
+ </p>
683
+
684
+ <p class="source_link" id="M000042-show-link"><a onclick="toggle('M000042-source'); toggleText('M000042-link'); return false;" href="#" id="M000042-link">Show source...</a></p><div class="source" id="M000042-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 392</span>
685
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">button_up</span>(<span class="ruby-identifier">id</span>); <span class="ruby-keyword kw">end</span></pre></div>
686
+ </div>
687
+
688
+ <a class="small" name="M000050"><br/></a>
689
+ <div class="method_block"><h3>
690
+ <a href='#M000050'>
691
+
692
+
693
+ clip_to
694
+
695
+ (x, y, w, h, &amp;drawing_code)
696
+
697
+ </a>
698
+ </h3>
699
+ <p>
700
+ Limits the drawing area to a given rectangle while evaluating the code
701
+ inside of the block.
702
+ </p>
703
+
704
+ <p class="source_link" id="M000050-show-link"><a onclick="toggle('M000050-source'); toggleText('M000050-link'); return false;" href="#" id="M000050-link">Show source...</a></p><div class="source" id="M000050-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 418</span>
705
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clip_to</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">drawing_code</span>); <span class="ruby-keyword kw">end</span></pre></div>
706
+ </div>
707
+
708
+ <a class="small" name="M000036"><br/></a>
709
+ <div class="method_block"><h3>
710
+ <a href='#M000036'>
711
+
712
+
713
+ close
714
+
715
+ ()
716
+
717
+ </a>
718
+ </h3>
719
+ <p>
720
+ Tells the window to end the current <a href="Window.html#M000035">show</a>
721
+ loop as soon as possible.
722
+ </p>
723
+
724
+ <p class="source_link" id="M000036-show-link"><a onclick="toggle('M000036-source'); toggleText('M000036-link'); return false;" href="#" id="M000036-link">Show source...</a></p><div class="source" id="M000036-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 367</span>
725
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>; <span class="ruby-keyword kw">end</span></pre></div>
726
+ </div>
727
+
728
+ <a class="small" name="M000038"><br/></a>
729
+ <div class="method_block"><h3>
730
+ <a href='#M000038'>
731
+
732
+
733
+ draw
734
+
735
+ ()
736
+
737
+ </a>
738
+ </h3>
739
+ <p>
740
+ Called after every <a href="Window.html#M000037">update</a> and when the OS
741
+ wants the window to repaint itself. Your application&#8216;s rendering code
742
+ goes here.
743
+ </p>
744
+
745
+ <p class="source_link" id="M000038-show-link"><a onclick="toggle('M000038-source'); toggleText('M000038-link'); return false;" href="#" id="M000038-link">Show source...</a></p><div class="source" id="M000038-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 375</span>
746
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>; <span class="ruby-keyword kw">end</span></pre></div>
747
+ </div>
748
+
749
+ <a class="small" name="M000043"><br/></a>
750
+ <div class="method_block"><h3>
751
+ <a href='#M000043'>
752
+
753
+
754
+ draw_line
755
+
756
+ (x1, y1, c1, x2, y2, c2, z=0, mode=:default)
757
+
758
+ </a>
759
+ </h3>
760
+ <p>
761
+ Draws a line from one point to another (last pixel exclusive).
762
+ </p>
763
+
764
+ <p class="source_link" id="M000043-show-link"><a onclick="toggle('M000043-source'); toggleText('M000043-link'); return false;" href="#" id="M000043-link">Show source...</a></p><div class="source" id="M000043-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 395</span>
765
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_line</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>, <span class="ruby-identifier">c2</span>, <span class="ruby-identifier">z</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:default</span>); <span class="ruby-keyword kw">end</span></pre></div>
766
+ </div>
767
+
768
+ <a class="small" name="M000045"><br/></a>
769
+ <div class="method_block"><h3>
770
+ <a href='#M000045'>
771
+
772
+
773
+ draw_quad
774
+
775
+ (x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z=0, mode=:default)
776
+
777
+ </a>
778
+ </h3>
779
+ <p>
780
+ Draws a rectangle (two triangles) with given corners and corresponding
781
+ colors. The points can be in clockwise order, or in a Z shape.
782
+ </p>
783
+
784
+ <p class="source_link" id="M000045-show-link"><a onclick="toggle('M000045-source'); toggleText('M000045-link'); return false;" href="#" id="M000045-link">Show source...</a></p><div class="source" id="M000045-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 402</span>
785
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_quad</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>, <span class="ruby-identifier">c2</span>, <span class="ruby-identifier">x3</span>, <span class="ruby-identifier">y3</span>, <span class="ruby-identifier">c3</span>, <span class="ruby-identifier">x4</span>, <span class="ruby-identifier">y4</span>, <span class="ruby-identifier">c4</span>, <span class="ruby-identifier">z</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:default</span>); <span class="ruby-keyword kw">end</span></pre></div>
786
+ </div>
787
+
788
+ <a class="small" name="M000044"><br/></a>
789
+ <div class="method_block"><h3>
790
+ <a href='#M000044'>
791
+
792
+
793
+ draw_triangle
794
+
795
+ (x1, y1, c1, x2, y2, c2, x3, y3, c3, z=0, mode=:default)
796
+
797
+ </a>
798
+ </h3>
799
+
800
+ <p class="source_link" id="M000044-show-link"><a onclick="toggle('M000044-source'); toggleText('M000044-link'); return false;" href="#" id="M000044-link">Show source...</a></p><div class="source" id="M000044-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 397</span>
801
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_triangle</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-identifier">c1</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>, <span class="ruby-identifier">c2</span>, <span class="ruby-identifier">x3</span>, <span class="ruby-identifier">y3</span>, <span class="ruby-identifier">c3</span>, <span class="ruby-identifier">z</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:default</span>); <span class="ruby-keyword kw">end</span></pre></div>
802
+ </div>
803
+
804
+ <a class="small" name="M000049"><br/></a>
805
+ <div class="method_block"><h3>
806
+ <a href='#M000049'>
807
+
808
+
809
+ gl
810
+
811
+ (&amp;custom_gl_code)
812
+
813
+ </a>
814
+ </h3>
815
+ <p>
816
+ See examples/OpenGLIntegration.rb.
817
+ </p>
818
+
819
+ <p class="source_link" id="M000049-show-link"><a onclick="toggle('M000049-source'); toggleText('M000049-link'); return false;" href="#" id="M000049-link">Show source...</a></p><div class="source" id="M000049-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 415</span>
820
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">custom_gl_code</span>); <span class="ruby-keyword kw">end</span></pre></div>
821
+ </div>
822
+
823
+ <a class="small" name="M000039"><br/></a>
824
+ <div class="method_block"><h3>
825
+ <a href='#M000039'>
826
+
827
+
828
+ needs_redraw?
829
+
830
+ ()
831
+
832
+ </a>
833
+ </h3>
834
+ <p>
835
+ Can be overriden to give the game a chance to say no to being redrawn. This
836
+ is not a definitive answer. The operating system can still cause redraws
837
+ for one reason or another.
838
+ </p>
839
+ <p>
840
+ By default, the window is redrawn all the time (i.e. Window#needs_draw?
841
+ always returns true.)
842
+ </p>
843
+
844
+ <p class="source_link" id="M000039-show-link"><a onclick="toggle('M000039-source'); toggleText('M000039-link'); return false;" href="#" id="M000039-link">Show source...</a></p><div class="source" id="M000039-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 383</span>
845
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">needs_redraw?</span>; <span class="ruby-keyword kw">end</span></pre></div>
846
+ </div>
847
+
848
+ <a class="small" name="M000040"><br/></a>
849
+ <div class="method_block"><h3>
850
+ <a href='#M000040'>
851
+
852
+
853
+ set_mouse_position
854
+
855
+ (x, y)
856
+
857
+ </a>
858
+ </h3>
859
+ <p>
860
+ To avoid the intermediate position of calling mouse_x= followed by
861
+ mouse_y=.
862
+ </p>
863
+
864
+ <p class="source_link" id="M000040-show-link"><a onclick="toggle('M000040-source'); toggleText('M000040-link'); return false;" href="#" id="M000040-link">Show source...</a></p><div class="source" id="M000040-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 386</span>
865
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_mouse_position</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>); <span class="ruby-keyword kw">end</span></pre></div>
866
+ </div>
867
+
868
+ <a class="small" name="M000035"><br/></a>
869
+ <div class="method_block"><h3>
870
+ <a href='#M000035'>
871
+
872
+
873
+ show
874
+
875
+ ()
876
+
877
+ </a>
878
+ </h3>
879
+ <p>
880
+ Enters a modal loop where the <a href="Window.html">Window</a> is visible
881
+ on screen and receives calls to <a href="Window.html#M000038">draw</a>, <a
882
+ href="Window.html#M000037">update</a> etc.
883
+ </p>
884
+
885
+ <p class="source_link" id="M000035-show-link"><a onclick="toggle('M000035-source'); toggleText('M000035-link'); return false;" href="#" id="M000035-link">Show source...</a></p><div class="source" id="M000035-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 364</span>
886
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>; <span class="ruby-keyword kw">end</span></pre></div>
887
+ </div>
888
+
889
+ <a class="small" name="M000037"><br/></a>
890
+ <div class="method_block"><h3>
891
+ <a href='#M000037'>
892
+
893
+
894
+ update
895
+
896
+ ()
897
+
898
+ </a>
899
+ </h3>
900
+ <p>
901
+ Called every update_interval milliseconds while the window is being shown.
902
+ Your application&#8216;s main game logic goes here.
903
+ </p>
904
+
905
+ <p class="source_link" id="M000037-show-link"><a onclick="toggle('M000037-source'); toggleText('M000037-link'); return false;" href="#" id="M000037-link">Show source...</a></p><div class="source" id="M000037-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 371</span>
906
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>; <span class="ruby-keyword kw">end</span></pre></div>
907
+ </div>
908
+
909
+
910
+
911
+
912
+
913
+ </div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>