gosu 0.7.15-x86-mswin32-60 → 0.7.16-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/examples/ChipmunkIntegration.rb +7 -7
  2. data/examples/CptnRuby.rb +5 -5
  3. data/examples/OpenGLIntegration.rb +6 -6
  4. data/examples/RMagickIntegration.rb +1 -1
  5. data/examples/TextInput.rb +7 -1
  6. data/examples/Tutorial.rb +5 -5
  7. data/lib/gosu.for_1_8.so +0 -0
  8. data/lib/gosu.for_1_9.so +0 -0
  9. data/lib/gosu.rb +6 -1
  10. data/lib/gosu/patches.rb +53 -0
  11. data/reference/rdoc/classes/Gosu.html +23 -3
  12. data/reference/rdoc/classes/Gosu/Color.html +127 -29
  13. data/reference/rdoc/classes/Gosu/Font.html +31 -21
  14. data/reference/rdoc/classes/Gosu/GLTexInfo.html +3 -3
  15. data/reference/rdoc/classes/Gosu/Image.html +52 -37
  16. data/reference/rdoc/classes/Gosu/Sample.html +19 -13
  17. data/reference/rdoc/classes/Gosu/SampleInstance.html +29 -19
  18. data/reference/rdoc/classes/Gosu/Song.html +41 -27
  19. data/reference/rdoc/classes/Gosu/TextInput.html +42 -3
  20. data/reference/rdoc/classes/Gosu/Window.html +102 -69
  21. data/reference/rdoc/classes/Numeric.html +7 -3
  22. data/reference/rdoc/created.rid +1 -1
  23. data/reference/rdoc/files/COPYING_txt.html +3 -3
  24. data/reference/rdoc/files/README_txt.html +3 -3
  25. data/reference/rdoc/files/reference/Deployment on OS X_rdoc.html +4 -19
  26. data/reference/rdoc/files/reference/Deployment on Windows_rdoc.html +18 -31
  27. data/reference/rdoc/files/reference/Drawing with Colors_rdoc.html +3 -3
  28. data/reference/rdoc/files/reference/Order of Corners_rdoc.html +3 -3
  29. data/reference/rdoc/files/reference/Tileability_rdoc.html +3 -3
  30. data/reference/rdoc/files/reference/Z Ordering_rdoc.html +3 -3
  31. data/reference/rdoc/files/reference/gosu_rb.html +3 -3
  32. data/reference/rdoc/fr_method_index.html +49 -48
  33. data/reference/rdoc/index.html +1 -1
  34. metadata +4 -65
  35. data/reference/rdoc/classes/Gosu.src/M000003.html +0 -0
  36. data/reference/rdoc/classes/Gosu.src/M000004.html +0 -0
  37. data/reference/rdoc/classes/Gosu.src/M000005.html +0 -0
  38. data/reference/rdoc/classes/Gosu.src/M000006.html +0 -0
  39. data/reference/rdoc/classes/Gosu.src/M000007.html +0 -0
  40. data/reference/rdoc/classes/Gosu.src/M000008.html +0 -0
  41. data/reference/rdoc/classes/Gosu.src/M000009.html +0 -0
  42. data/reference/rdoc/classes/Gosu.src/M000010.html +0 -0
  43. data/reference/rdoc/classes/Gosu.src/M000011.html +0 -0
  44. data/reference/rdoc/classes/Gosu.src/M000012.html +0 -0
  45. data/reference/rdoc/classes/Gosu/Color.src/M000016.html +0 -0
  46. data/reference/rdoc/classes/Gosu/Color.src/M000017.html +0 -0
  47. data/reference/rdoc/classes/Gosu/Color.src/M000018.html +0 -0
  48. data/reference/rdoc/classes/Gosu/Color.src/M000019.html +0 -0
  49. data/reference/rdoc/classes/Gosu/Font.src/M000029.html +0 -0
  50. data/reference/rdoc/classes/Gosu/Font.src/M000030.html +0 -0
  51. data/reference/rdoc/classes/Gosu/Font.src/M000031.html +0 -0
  52. data/reference/rdoc/classes/Gosu/Font.src/M000032.html +0 -0
  53. data/reference/rdoc/classes/Gosu/Font.src/M000033.html +0 -0
  54. data/reference/rdoc/classes/Gosu/Image.src/M000020.html +0 -0
  55. data/reference/rdoc/classes/Gosu/Image.src/M000021.html +0 -0
  56. data/reference/rdoc/classes/Gosu/Image.src/M000022.html +0 -0
  57. data/reference/rdoc/classes/Gosu/Image.src/M000023.html +0 -0
  58. data/reference/rdoc/classes/Gosu/Image.src/M000024.html +0 -0
  59. data/reference/rdoc/classes/Gosu/Image.src/M000025.html +0 -0
  60. data/reference/rdoc/classes/Gosu/Image.src/M000026.html +0 -0
  61. data/reference/rdoc/classes/Gosu/Image.src/M000027.html +0 -0
  62. data/reference/rdoc/classes/Gosu/Image.src/M000028.html +0 -0
  63. data/reference/rdoc/classes/Gosu/Sample.src/M000013.html +0 -0
  64. data/reference/rdoc/classes/Gosu/Sample.src/M000014.html +0 -0
  65. data/reference/rdoc/classes/Gosu/Sample.src/M000015.html +0 -0
  66. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000051.html +0 -0
  67. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000052.html +0 -0
  68. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000053.html +0 -0
  69. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000054.html +0 -0
  70. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000055.html +0 -0
  71. data/reference/rdoc/classes/Gosu/Song.src/M000056.html +0 -0
  72. data/reference/rdoc/classes/Gosu/Song.src/M000057.html +0 -0
  73. data/reference/rdoc/classes/Gosu/Song.src/M000058.html +0 -0
  74. data/reference/rdoc/classes/Gosu/Song.src/M000059.html +0 -0
  75. data/reference/rdoc/classes/Gosu/Song.src/M000060.html +0 -0
  76. data/reference/rdoc/classes/Gosu/Song.src/M000061.html +0 -0
  77. data/reference/rdoc/classes/Gosu/Song.src/M000062.html +0 -0
  78. data/reference/rdoc/classes/Gosu/Window.src/M000034.html +0 -0
  79. data/reference/rdoc/classes/Gosu/Window.src/M000035.html +0 -0
  80. data/reference/rdoc/classes/Gosu/Window.src/M000036.html +0 -0
  81. data/reference/rdoc/classes/Gosu/Window.src/M000037.html +0 -0
  82. data/reference/rdoc/classes/Gosu/Window.src/M000038.html +0 -0
  83. data/reference/rdoc/classes/Gosu/Window.src/M000039.html +0 -0
  84. data/reference/rdoc/classes/Gosu/Window.src/M000040.html +0 -0
  85. data/reference/rdoc/classes/Gosu/Window.src/M000041.html +0 -0
  86. data/reference/rdoc/classes/Gosu/Window.src/M000042.html +0 -0
  87. data/reference/rdoc/classes/Gosu/Window.src/M000043.html +0 -0
  88. data/reference/rdoc/classes/Gosu/Window.src/M000044.html +0 -0
  89. data/reference/rdoc/classes/Gosu/Window.src/M000045.html +0 -0
  90. data/reference/rdoc/classes/Gosu/Window.src/M000046.html +0 -0
  91. data/reference/rdoc/classes/Gosu/Window.src/M000047.html +0 -0
  92. data/reference/rdoc/classes/Gosu/Window.src/M000048.html +0 -0
  93. data/reference/rdoc/classes/Gosu/Window.src/M000049.html +0 -0
  94. data/reference/rdoc/classes/Gosu/Window.src/M000050.html +0 -0
  95. data/reference/rdoc/classes/Numeric.src/M000001.html +0 -0
  96. data/reference/rdoc/classes/Numeric.src/M000002.html +0 -0
@@ -131,7 +131,7 @@ class GameWindow < Gosu::Window
131
131
  @background_image = Gosu::Image.new(self, "media/Space.png", true)
132
132
 
133
133
  # Put the beep here, as it is the environment now that determines collision
134
- @beep = Gosu::Sample.new(self, "media/Beep.wav")
134
+ @beep = Gosu::Sample.new("media/Beep.wav")
135
135
 
136
136
  # Put the score here, as it is the environment that tracks this now
137
137
  @score = 0
@@ -222,20 +222,20 @@ class GameWindow < Gosu::Window
222
222
  @player.validate_position
223
223
 
224
224
  # Check keyboard
225
- if button_down? Gosu::Button::KbLeft
225
+ if button_down? Gosu::KbLeft
226
226
  @player.turn_left
227
227
  end
228
- if button_down? Gosu::Button::KbRight
228
+ if button_down? Gosu::KbRight
229
229
  @player.turn_right
230
230
  end
231
231
 
232
- if button_down? Gosu::Button::KbUp
233
- if ( (button_down? Gosu::Button::KbRightShift) || (button_down? Gosu::Button::KbLeftShift) )
232
+ if button_down? Gosu::KbUp
233
+ if ( (button_down? Gosu::KbRightShift) || (button_down? Gosu::KbLeftShift) )
234
234
  @player.boost
235
235
  else
236
236
  @player.accelerate
237
237
  end
238
- elsif button_down? Gosu::Button::KbDown
238
+ elsif button_down? Gosu::KbDown
239
239
  @player.reverse
240
240
  end
241
241
 
@@ -265,7 +265,7 @@ class GameWindow < Gosu::Window
265
265
  end
266
266
 
267
267
  def button_down(id)
268
- if id == Gosu::Button::KbEscape
268
+ if id == Gosu::KbEscape
269
269
  close
270
270
  end
271
271
  end
@@ -151,7 +151,7 @@ class Map
151
151
  gem_img = Image.new(window, "media/CptnRuby Gem.png", false)
152
152
  @gems = []
153
153
 
154
- lines = File.readlines(filename).map { |line| line.chop }
154
+ lines = File.readlines(filename).map { |line| line.chomp }
155
155
  @height = lines.size
156
156
  @width = lines[0].size
157
157
  @tiles = Array.new(@width) do |x|
@@ -210,8 +210,8 @@ class Game < Window
210
210
  end
211
211
  def update
212
212
  move_x = 0
213
- move_x -= 5 if button_down? Button::KbLeft
214
- move_x += 5 if button_down? Button::KbRight
213
+ move_x -= 5 if button_down? KbLeft
214
+ move_x += 5 if button_down? KbRight
215
215
  @cptn.update(move_x)
216
216
  @cptn.collect_gems(@map.gems)
217
217
  # Scrolling follows player
@@ -223,8 +223,8 @@ class Game < Window
223
223
  @cptn.draw @screen_x, @screen_y
224
224
  end
225
225
  def button_down(id)
226
- if id == Button::KbUp then @cptn.try_to_jump end
227
- if id == Button::KbEscape then close end
226
+ if id == KbUp then @cptn.try_to_jump end
227
+ if id == KbEscape then close end
228
228
  end
229
229
  end
230
230
 
@@ -108,7 +108,7 @@ class Player
108
108
 
109
109
  def initialize(window, x, y)
110
110
  @image = Gosu::Image.new(window, "media/Starfighter.bmp", false)
111
- @beep = Gosu::Sample.new(window, "media/Beep.wav")
111
+ @beep = Gosu::Sample.new("media/Beep.wav")
112
112
  @x, @y = x, y
113
113
  @score = 0
114
114
  end
@@ -190,10 +190,10 @@ class GameWindow < Gosu::Window
190
190
  end
191
191
 
192
192
  def update
193
- @player.move_left if button_down? Gosu::Button::KbLeft or button_down? Gosu::Button::GpLeft
194
- @player.move_right if button_down? Gosu::Button::KbRight or button_down? Gosu::Button::GpRight
195
- @player.accelerate if button_down? Gosu::Button::KbUp or button_down? Gosu::Button::GpUp
196
- @player.brake if button_down? Gosu::Button::KbDown or button_down? Gosu::Button::GpDown
193
+ @player.move_left if button_down? Gosu::KbLeft or button_down? Gosu::GpLeft
194
+ @player.move_right if button_down? Gosu::KbRight or button_down? Gosu::GpRight
195
+ @player.accelerate if button_down? Gosu::KbUp or button_down? Gosu::GpUp
196
+ @player.brake if button_down? Gosu::KbDown or button_down? Gosu::GpDown
197
197
 
198
198
  @player.collect_stars(@stars)
199
199
 
@@ -222,7 +222,7 @@ class GameWindow < Gosu::Window
222
222
  end
223
223
 
224
224
  def button_down(id)
225
- if id == Gosu::Button::KbEscape
225
+ if id == Gosu::KbEscape
226
226
  close
227
227
  end
228
228
  end
@@ -290,7 +290,7 @@ class Missile
290
290
 
291
291
  def initialize(window, x, y, angle)
292
292
  # All missile instances use the same sound.
293
- @@explosion_sound ||= Gosu::Sample.new(window, "media/Explosion.wav")
293
+ @@explosion_sound ||= Gosu::Sample.new("media/Explosion.wav")
294
294
 
295
295
  # Horizontal/vertical velocity.
296
296
  @vx, @vy = Gosu::offset_x(angle, 20).to_i, Gosu::offset_y(angle, 20).to_i
@@ -47,6 +47,12 @@ class TextField < Gosu::TextInput
47
47
  self.text = "Click to change text"
48
48
  end
49
49
 
50
+ # Example filter method. You can truncate the text to employ a length limit (watch out
51
+ # with Ruby 1.8 and UTF-8!), limit the text to certain characters etc.
52
+ def filter text
53
+ text.upcase
54
+ end
55
+
50
56
  def draw
51
57
  # Depending on whether this is the currently selected input or not, change the
52
58
  # background's color.
@@ -82,7 +88,7 @@ class TextField < Gosu::TextInput
82
88
  end
83
89
 
84
90
  # This text field grows with the text that's being entered.
85
- # (Without clipping, one has to be a bit creative about this ;) )
91
+ # (Usually one would use clip_to and scroll around on the text field.)
86
92
  def width
87
93
  @font.text_width(self.text)
88
94
  end
@@ -16,7 +16,7 @@ class Player
16
16
 
17
17
  def initialize(window)
18
18
  @image = Gosu::Image.new(window, "media/Starfighter.bmp", false)
19
- @beep = Gosu::Sample.new(window, "media/Beep.wav")
19
+ @beep = Gosu::Sample.new("media/Beep.wav")
20
20
  @x = @y = @vel_x = @vel_y = @angle = 0.0
21
21
  @score = 0
22
22
  end
@@ -102,13 +102,13 @@ class GameWindow < Gosu::Window
102
102
  end
103
103
 
104
104
  def update
105
- if button_down? Gosu::Button::KbLeft or button_down? Gosu::Button::GpLeft then
105
+ if button_down? Gosu::KbLeft or button_down? Gosu::GpLeft then
106
106
  @player.turn_left
107
107
  end
108
- if button_down? Gosu::Button::KbRight or button_down? Gosu::Button::GpRight then
108
+ if button_down? Gosu::KbRight or button_down? Gosu::GpRight then
109
109
  @player.turn_right
110
110
  end
111
- if button_down? Gosu::Button::KbUp or button_down? Gosu::Button::GpButton0 then
111
+ if button_down? Gosu::KbUp or button_down? Gosu::GpButton0 then
112
112
  @player.accelerate
113
113
  end
114
114
  @player.move
@@ -127,7 +127,7 @@ class GameWindow < Gosu::Window
127
127
  end
128
128
 
129
129
  def button_down(id)
130
- if id == Gosu::Button::KbEscape then
130
+ if id == Gosu::KbEscape then
131
131
  close
132
132
  end
133
133
  end
Binary file
Binary file
@@ -1,7 +1,10 @@
1
1
  require 'rbconfig'
2
2
 
3
3
  begin
4
- if RUBY_VERSION and RUBY_VERSION[0..2] == '1.9' then
4
+ if defined? NSObject then
5
+ require "#{File.dirname(__FILE__)}/gosu.for_macruby.bundle"
6
+ require "#{File.dirname(__FILE__)}/hotgosu.rb"
7
+ elsif defined? RUBY_VERSION and RUBY_VERSION[0..2] == '1.9' then
5
8
  require "#{File.dirname(__FILE__)}/gosu.for_1_9.#{Config::CONFIG['DLEXT']}"
6
9
  else
7
10
  require "#{File.dirname(__FILE__)}/gosu.for_1_8.#{Config::CONFIG['DLEXT']}"
@@ -9,3 +12,5 @@ begin
9
12
  rescue LoadError => e
10
13
  require "#{File.dirname(__FILE__)}/gosu.#{Config::CONFIG['DLEXT']}"
11
14
  end
15
+
16
+ require "#{File.dirname(__FILE__)}/gosu/patches.rb"
@@ -0,0 +1,53 @@
1
+ # Extend Numeric with simple angle conversion methods.
2
+ class ::Numeric
3
+ def gosu_to_radian_scale
4
+ self * Math::PI / 180.0
5
+ end
6
+ def radian_scale_to_gosu
7
+ self * 180.0 / Math::PI
8
+ end
9
+ def gosu_to_radians
10
+ (self - 90) * Math::PI / 180.0
11
+ end
12
+ def radians_to_gosu
13
+ self * 180.0 / Math::PI + 90
14
+ end
15
+ end
16
+
17
+ # Backwards compatibility: import the constants into Gosu::Button.
18
+ module Gosu::Button
19
+ Gosu.constants.each { |c| const_set(c, Gosu.const_get(c)) }
20
+ end
21
+
22
+ # Backwards compatibility: Window arguments to Sample and Song
23
+ class Gosu::Sample
24
+ alias new_initialize initialize
25
+
26
+ def initialize(*args)
27
+ args.shift if args.first.is_a? Gosu::Window
28
+ new_initialize args
29
+ end
30
+ end
31
+ class Gosu::Song
32
+ alias new_initialize initialize
33
+
34
+ def initialize(*args)
35
+ args.shift if args.first.is_a? Gosu::Window
36
+ new_initialize args
37
+ end
38
+ end
39
+
40
+ # Color constants (SWIG messes up constants somehow)
41
+ class Gosu::Color
42
+ NONE = Gosu::Color.new(0x00000000)
43
+ BLACK = Gosu::Color.new(0xff000000)
44
+ GRAY = Gosu::Color.new(0xff808080)
45
+ WHITE = Gosu::Color.new(0xffffffff)
46
+ AQUA = Gosu::Color.new(0xff00ffff)
47
+ RED = Gosu::Color.new(0xffff0000)
48
+ GREEN = Gosu::Color.new(0xff00ff00)
49
+ BLUE = Gosu::Color.new(0xff0000ff)
50
+ YELLOW = Gosu::Color.new(0xffffff00)
51
+ FUCHSIA = Gosu::Color.new(0xffff00ff)
52
+ CYAN = Gosu::Color.new(0xff00ffff)
53
+ end
@@ -1,4 +1,4 @@
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>Module: Gosu</title><link type="text/css" media="screen" rel="stylesheet" href=".././rdoc-style.css"/><script type="text/javascript">
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>Module: Gosu</title><link type="text/css" media="screen" href=".././rdoc-style.css" rel="stylesheet"/><script type="text/javascript">
2
2
  // Allison template
3
3
  // Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.
4
4
 
@@ -409,7 +409,7 @@ screen_width<br/>
409
409
 
410
410
 
411
411
  </div>
412
- <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;" id="class_link" href="#">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_class" onKeyUp="return filterList('class', this.value, event);"></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;" id="file_link" href="#">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_file" onKeyUp="return filterList('file', this.value, event);"></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;" id="method_link" href="#">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_method" onKeyUp="return filterList('method', this.value, event);"></input></form></div></div></div><div id="content">
412
+ <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 href="#" onclick="toggle('class'); toggleText('class_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_class" onKeyUp="return filterList('class', this.value, event);"></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 href="#" onclick="toggle('file'); toggleText('file_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_file" onKeyUp="return filterList('file', this.value, event);"></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 href="#" onclick="toggle('method'); toggleText('method_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_method" onKeyUp="return filterList('method', this.value, event);"></input></form></div></div></div><div id="content">
413
413
 
414
414
 
415
415
 
@@ -1364,6 +1364,8 @@ Returns the <a href="Gosu.html#M000006">angle</a> from point 1 to point 2
1364
1364
  in degrees, where 0.0 means upwards. Returns 0 if both points are equal.
1365
1365
  </p>
1366
1366
 
1367
+ <p class="source_link" id="M000006-show-link"><a href="#" onclick="toggle('M000006-source'); toggleText('M000006-link'); return false;" id="M000006-link">Show source...</a></p><div class="source" id="M000006-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 458</span>
1368
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">angle</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>); <span class="ruby-keyword kw">end</span></pre></div>
1367
1369
  </div>
1368
1370
 
1369
1371
  <a class="small" name="M000007"><br/></a>
@@ -1383,6 +1385,8 @@ added to angle1 to get to angle2 (can be negative if counter-clockwise
1383
1385
  movement is shorter).
1384
1386
  </p>
1385
1387
 
1388
+ <p class="source_link" id="M000007-show-link"><a href="#" onclick="toggle('M000007-source'); toggleText('M000007-link'); return false;" id="M000007-link">Show source...</a></p><div class="source" id="M000007-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 461</span>
1389
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">angle_diff</span>(<span class="ruby-identifier">angle1</span>, <span class="ruby-identifier">angle2</span>); <span class="ruby-keyword kw">end</span></pre></div>
1386
1390
  </div>
1387
1391
 
1388
1392
  <a class="small" name="M000010"><br/></a>
@@ -1401,6 +1405,8 @@ Returns the name of a neutral font that is available on the current
1401
1405
  platform.
1402
1406
  </p>
1403
1407
 
1408
+ <p class="source_link" id="M000010-show-link"><a href="#" onclick="toggle('M000010-source'); toggleText('M000010-link'); return false;" id="M000010-link">Show source...</a></p><div class="source" id="M000010-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 471</span>
1409
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_font_name</span>(); <span class="ruby-keyword kw">end</span></pre></div>
1404
1410
  </div>
1405
1411
 
1406
1412
  <a class="small" name="M000008"><br/></a>
@@ -1418,6 +1424,8 @@ distance
1418
1424
  Returns the <a href="Gosu.html#M000008">distance</a> between two points.
1419
1425
  </p>
1420
1426
 
1427
+ <p class="source_link" id="M000008-show-link"><a href="#" onclick="toggle('M000008-source'); toggleText('M000008-link'); return false;" id="M000008-link">Show source...</a></p><div class="source" id="M000008-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 464</span>
1428
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">distance</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>); <span class="ruby-keyword kw">end</span></pre></div>
1421
1429
  </div>
1422
1430
 
1423
1431
  <a class="small" name="M000009"><br/></a>
@@ -1435,6 +1443,8 @@ milliseconds
1435
1443
  Incrementing, possibly wrapping millisecond timer.
1436
1444
  </p>
1437
1445
 
1446
+ <p class="source_link" id="M000009-show-link"><a href="#" onclick="toggle('M000009-source'); toggleText('M000009-link'); return false;" id="M000009-link">Show source...</a></p><div class="source" id="M000009-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 467</span>
1447
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">milliseconds</span>(); <span class="ruby-keyword kw">end</span></pre></div>
1438
1448
  </div>
1439
1449
 
1440
1450
  <a class="small" name="M000004"><br/></a>
@@ -1454,6 +1464,8 @@ origin and the point to which you would get if you moved radius pixels in
1454
1464
  the direction specified by <a href="Gosu.html#M000006">angle</a>.
1455
1465
  </p>
1456
1466
 
1467
+ <p class="source_link" id="M000004-show-link"><a href="#" onclick="toggle('M000004-source'); toggleText('M000004-link'); return false;" id="M000004-link">Show source...</a></p><div class="source" id="M000004-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 452</span>
1468
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">offset_x</span>(<span class="ruby-identifier">angle</span>, <span class="ruby-identifier">dist</span>); <span class="ruby-keyword kw">end</span></pre></div>
1457
1469
  </div>
1458
1470
 
1459
1471
  <a class="small" name="M000005"><br/></a>
@@ -1473,6 +1485,8 @@ origin and the point to which you would get if you moved radius pixels in
1473
1485
  the direction specified by <a href="Gosu.html#M000006">angle</a>.
1474
1486
  </p>
1475
1487
 
1488
+ <p class="source_link" id="M000005-show-link"><a href="#" onclick="toggle('M000005-source'); toggleText('M000005-link'); return false;" id="M000005-link">Show source...</a></p><div class="source" id="M000005-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 455</span>
1489
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">offset_y</span>(<span class="ruby-identifier">angle</span>, <span class="ruby-identifier">dist</span>); <span class="ruby-keyword kw">end</span></pre></div>
1476
1490
  </div>
1477
1491
 
1478
1492
  <a class="small" name="M000003"><br/></a>
@@ -1491,6 +1505,8 @@ Returns a <a href="Gosu.html#M000003">random</a> double between min
1491
1505
  (inclusive) and max (exclusive).
1492
1506
  </p>
1493
1507
 
1508
+ <p class="source_link" id="M000003-show-link"><a href="#" onclick="toggle('M000003-source'); toggleText('M000003-link'); return false;" id="M000003-link">Show source...</a></p><div class="source" id="M000003-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 449</span>
1509
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">random</span>(<span class="ruby-identifier">min</span>, <span class="ruby-identifier">max</span>); <span class="ruby-keyword kw">end</span></pre></div>
1494
1510
  </div>
1495
1511
 
1496
1512
  <a class="small" name="M000012"><br/></a>
@@ -1508,6 +1524,8 @@ screen_height
1508
1524
  Returns the height, in pixels, of the user&#8216;s primary screen.
1509
1525
  </p>
1510
1526
 
1527
+ <p class="source_link" id="M000012-show-link"><a href="#" onclick="toggle('M000012-source'); toggleText('M000012-link'); return false;" id="M000012-link">Show source...</a></p><div class="source" id="M000012-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 477</span>
1528
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">screen_height</span>(); <span class="ruby-keyword kw">end</span></pre></div>
1511
1529
  </div>
1512
1530
 
1513
1531
  <a class="small" name="M000011"><br/></a>
@@ -1525,10 +1543,12 @@ screen_width
1525
1543
  Returns the width, in pixels, of the user&#8216;s primary screen.
1526
1544
  </p>
1527
1545
 
1546
+ <p class="source_link" id="M000011-show-link"><a href="#" onclick="toggle('M000011-source'); toggleText('M000011-link'); return false;" id="M000011-link">Show source...</a></p><div class="source" id="M000011-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 474</span>
1547
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">screen_width</span>(); <span class="ruby-keyword kw">end</span></pre></div>
1528
1548
  </div>
1529
1549
 
1530
1550
 
1531
1551
 
1532
1552
 
1533
1553
 
1534
- </div><div class="clear" id="footer">Generated on Sep 13, 2009 / Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a><br/>slightly adapted for the Gosu project by Julian Raschke</div></div></body></html>
1554
+ </div><div class="clear" id="footer">Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a><br/>slightly adapted for the Gosu project by Julian Raschke</div></div></body></html>
@@ -1,4 +1,4 @@
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::Color</title><link type="text/css" media="screen" rel="stylesheet" href="../.././rdoc-style.css"/><script type="text/javascript">
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::Color</title><link type="text/css" media="screen" href="../.././rdoc-style.css" rel="stylesheet"/><script type="text/javascript">
2
2
  // Allison template
3
3
  // Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.
4
4
 
@@ -344,34 +344,34 @@ Object
344
344
  <div class="navigation top" id="methods"><h3>Methods</h3>
345
345
 
346
346
 
347
- <a href='#M000019'>
347
+ <a href='#M000020'>
348
348
  from_ahsv<br/>
349
349
  </a>
350
350
 
351
351
 
352
352
 
353
353
 
354
- <a href='#M000018'>
354
+ <a href='#M000019'>
355
355
  from_hsv<br/>
356
356
  </a>
357
357
 
358
358
 
359
359
 
360
360
 
361
- <a href='#M000017'>
361
+ <a href='#M000018'>
362
362
  new<br/>
363
363
  </a>
364
364
 
365
365
 
366
366
 
367
367
 
368
- <a href='#M000016'>
368
+ <a href='#M000017'>
369
369
  new<br/>
370
370
  </a>
371
371
 
372
372
 
373
373
  </div>
374
- <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;" id="class_link" href="#">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_class" onKeyUp="return filterList('class', this.value, event);"></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;" id="file_link" href="#">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_file" onKeyUp="return filterList('file', this.value, event);"></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;" id="method_link" href="#">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:&nbsp;&nbsp;</label><input type="text" onKeyPress="return disableSubmit(event);" id="filter_method" onKeyUp="return filterList('method', this.value, event);"></input></form></div></div></div><div id="content">
374
+ <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 href="#" onclick="toggle('class'); toggleText('class_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_class" onKeyUp="return filterList('class', this.value, event);"></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 href="#" onclick="toggle('file'); toggleText('file_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_file" onKeyUp="return filterList('file', this.value, event);"></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 href="#" onclick="toggle('method'); toggleText('method_link'); return false;" 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" onKeyPress="return disableSubmit(event);" id="filter_method" onKeyUp="return filterList('method', this.value, event);"></input></form></div></div></div><div id="content">
375
375
  <div id="description"><p>
376
376
  Represents an ARGB color value with 8 bits for each channel. Can be
377
377
  replaced by literals of the form 0xaarrggbb in all of <a
@@ -385,6 +385,96 @@ href="../Gosu.html">Gosu</a>.
385
385
  <p></p>
386
386
 
387
387
 
388
+ <h1>Constants</h1><p><table><tr><th>Name</th><th>Value</th></tr>
389
+ <tr>
390
+ <td class="highlight">NONE</td>
391
+
392
+ <td class="normal">Gosu::Color.new(0x00000000)</td>
393
+
394
+
395
+
396
+ </tr>
397
+ <tr>
398
+ <td class="highlight">BLACK</td>
399
+
400
+ <td class="normal">Gosu::Color.new(0xff000000)</td>
401
+
402
+
403
+
404
+ </tr>
405
+ <tr>
406
+ <td class="highlight">GRAY</td>
407
+
408
+ <td class="normal">Gosu::Color.new(0xff808080)</td>
409
+
410
+
411
+
412
+ </tr>
413
+ <tr>
414
+ <td class="highlight">WHITE</td>
415
+
416
+ <td class="normal">Gosu::Color.new(0xffffffff)</td>
417
+
418
+
419
+
420
+ </tr>
421
+ <tr>
422
+ <td class="highlight">AQUA</td>
423
+
424
+ <td class="normal">Gosu::Color.new(0xff00ffff)</td>
425
+
426
+
427
+
428
+ </tr>
429
+ <tr>
430
+ <td class="highlight">RED</td>
431
+
432
+ <td class="normal">Gosu::Color.new(0xffff0000)</td>
433
+
434
+
435
+
436
+ </tr>
437
+ <tr>
438
+ <td class="highlight">GREEN</td>
439
+
440
+ <td class="normal">Gosu::Color.new(0xff00ff00)</td>
441
+
442
+
443
+
444
+ </tr>
445
+ <tr>
446
+ <td class="highlight">BLUE</td>
447
+
448
+ <td class="normal">Gosu::Color.new(0xff0000ff)</td>
449
+
450
+
451
+
452
+ </tr>
453
+ <tr>
454
+ <td class="highlight">YELLOW</td>
455
+
456
+ <td class="normal">Gosu::Color.new(0xffffff00)</td>
457
+
458
+
459
+
460
+ </tr>
461
+ <tr>
462
+ <td class="highlight">FUCHSIA</td>
463
+
464
+ <td class="normal">Gosu::Color.new(0xffff00ff)</td>
465
+
466
+
467
+
468
+ </tr>
469
+ <tr>
470
+ <td class="highlight">CYAN</td>
471
+
472
+ <td class="normal">Gosu::Color.new(0xff00ffff)</td>
473
+
474
+
475
+
476
+ </tr>
477
+ </table></p>
388
478
 
389
479
 
390
480
  <h1>Attributes</h1><p><table><tr><th>Name</th><th>Read/write?</th></tr>
@@ -450,9 +540,9 @@ href="../Gosu.html">Gosu</a>.
450
540
  <h1>Public Class Methods</h1>
451
541
 
452
542
 
453
- <a class="small" name="M000019"><br/></a>
543
+ <a class="small" name="M000020"><br/></a>
454
544
  <div class="method_block"><h3>
455
- <a href='#M000019'>
545
+ <a href='#M000020'>
456
546
 
457
547
 
458
548
  from_ahsv
@@ -479,11 +569,13 @@ Converts a HSV triple into a color, with a given alpha.
479
569
  </td></tr>
480
570
  </table>
481
571
 
572
+ <p class="source_link" id="M000020-show-link"><a href="#" onclick="toggle('M000020-source'); toggleText('M000020-link'); return false;" id="M000020-link">Show source...</a></p><div class="source" id="M000020-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 149</span>
573
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_ahsv</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">h</span>, <span class="ruby-identifier">s</span>, <span class="ruby-identifier">v</span>); <span class="ruby-keyword kw">end</span></pre></div>
482
574
  </div>
483
575
 
484
- <a class="small" name="M000018"><br/></a>
576
+ <a class="small" name="M000019"><br/></a>
485
577
  <div class="method_block"><h3>
486
- <a href='#M000018'>
578
+ <a href='#M000019'>
487
579
 
488
580
 
489
581
  from_hsv
@@ -494,7 +586,7 @@ from_hsv
494
586
  </h3>
495
587
  <p>
496
588
  Converts a HSV triple into a color. Same as <a
497
- href="Color.html#M000019">from_ahsv</a> with alpha set to 255.
589
+ href="Color.html#M000020">from_ahsv</a> with alpha set to 255.
498
590
  </p>
499
591
  <table>
500
592
  <tr><td valign="top">h:</td><td>Integer from 0..360
@@ -508,6 +600,27 @@ href="Color.html#M000019">from_ahsv</a> with alpha set to 255.
508
600
  </td></tr>
509
601
  </table>
510
602
 
603
+ <p class="source_link" id="M000019-show-link"><a href="#" onclick="toggle('M000019-source'); toggleText('M000019-link'); return false;" id="M000019-link">Show source...</a></p><div class="source" id="M000019-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 142</span>
604
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_hsv</span>(<span class="ruby-identifier">h</span>, <span class="ruby-identifier">s</span>, <span class="ruby-identifier">v</span>); <span class="ruby-keyword kw">end</span></pre></div>
605
+ </div>
606
+
607
+ <a class="small" name="M000018"><br/></a>
608
+ <div class="method_block"><h3>
609
+ <a href='#M000018'>
610
+
611
+
612
+ new
613
+
614
+ (argb)
615
+
616
+ </a>
617
+ </h3>
618
+ <p>
619
+ argb: 0xAARRGGBB integer.
620
+ </p>
621
+
622
+ <p class="source_link" id="M000018-show-link"><a href="#" onclick="toggle('M000018-source'); toggleText('M000018-link'); return false;" id="M000018-link">Show source...</a></p><div class="source" id="M000018-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 136</span>
623
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">argb</span>); <span class="ruby-keyword kw">end</span></pre></div>
511
624
  </div>
512
625
 
513
626
  <a class="small" name="M000017"><br/></a>
@@ -536,27 +649,12 @@ new
536
649
  </td></tr>
537
650
  </table>
538
651
 
539
- </div>
540
-
541
- <a class="small" name="M000016"><br/></a>
542
- <div class="method_block"><h3>
543
- <a href='#M000016'>
544
-
545
-
546
- new
547
-
548
- (argb)
549
-
550
- </a>
551
- </h3>
552
- <p>
553
- argb: 0xAARRGGBB integer.
554
- </p>
555
-
652
+ <p class="source_link" id="M000017-show-link"><a href="#" onclick="toggle('M000017-source'); toggleText('M000017-link'); return false;" id="M000017-link">Show source...</a></p><div class="source" id="M000017-source"><pre><span class="ruby-comment cmt"># File reference/gosu.rb, line 133</span>
653
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">r</span>, <span class="ruby-identifier">g</span>, <span class="ruby-identifier">b</span>); <span class="ruby-keyword kw">end</span></pre></div>
556
654
  </div>
557
655
 
558
656
 
559
657
 
560
658
 
561
659
 
562
- </div><div class="clear" id="footer">Generated on Sep 13, 2009 / Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a><br/>slightly adapted for the Gosu project by Julian Raschke</div></div></body></html>
660
+ </div><div class="clear" id="footer">Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a><br/>slightly adapted for the Gosu project by Julian Raschke</div></div></body></html>