gosu 0.7.15-universal-darwin → 0.7.16-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) 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.bundle +0 -0
  8. data/lib/gosu.for_1_9.bundle +0 -0
  9. data/lib/gosu.rb +6 -1
  10. data/lib/gosu/patches.rb +53 -0
  11. data/lib/hotgosu.rb +59 -0
  12. data/lib/hotgosu/color.rb +43 -0
  13. data/lib/hotgosu/constants.rb +143 -0
  14. data/lib/hotgosu/font.rb +26 -0
  15. data/lib/hotgosu/functions.rb +41 -0
  16. data/lib/hotgosu/image.rb +64 -0
  17. data/lib/hotgosu/sample.rb +15 -0
  18. data/lib/hotgosu/song.rb +25 -0
  19. data/lib/hotgosu/window.rb +146 -0
  20. data/{reference/rdoc/classes/Gosu.src/M000003.html → lib/hotgosu/window_primitives.rb} +0 -0
  21. data/reference/rdoc/classes/Gosu.html +23 -3
  22. data/reference/rdoc/classes/Gosu/Color.html +127 -29
  23. data/reference/rdoc/classes/Gosu/Font.html +31 -21
  24. data/reference/rdoc/classes/Gosu/GLTexInfo.html +3 -3
  25. data/reference/rdoc/classes/Gosu/Image.html +52 -37
  26. data/reference/rdoc/classes/Gosu/Sample.html +19 -13
  27. data/reference/rdoc/classes/Gosu/SampleInstance.html +29 -19
  28. data/reference/rdoc/classes/Gosu/Song.html +41 -27
  29. data/reference/rdoc/classes/Gosu/TextInput.html +42 -3
  30. data/reference/rdoc/classes/Gosu/Window.html +102 -69
  31. data/reference/rdoc/classes/Numeric.html +7 -3
  32. data/reference/rdoc/created.rid +1 -1
  33. data/reference/rdoc/files/COPYING_txt.html +3 -3
  34. data/reference/rdoc/files/README_txt.html +3 -3
  35. data/reference/rdoc/files/reference/Deployment on OS X_rdoc.html +4 -19
  36. data/reference/rdoc/files/reference/Deployment on Windows_rdoc.html +18 -31
  37. data/reference/rdoc/files/reference/Drawing with Colors_rdoc.html +3 -3
  38. data/reference/rdoc/files/reference/Order of Corners_rdoc.html +3 -3
  39. data/reference/rdoc/files/reference/Tileability_rdoc.html +3 -3
  40. data/reference/rdoc/files/reference/Z Ordering_rdoc.html +3 -3
  41. data/reference/rdoc/files/reference/gosu_rb.html +3 -3
  42. data/reference/rdoc/fr_method_index.html +49 -48
  43. data/reference/rdoc/index.html +1 -1
  44. metadata +14 -65
  45. data/reference/rdoc/classes/Gosu.src/M000004.html +0 -0
  46. data/reference/rdoc/classes/Gosu.src/M000005.html +0 -0
  47. data/reference/rdoc/classes/Gosu.src/M000006.html +0 -0
  48. data/reference/rdoc/classes/Gosu.src/M000007.html +0 -0
  49. data/reference/rdoc/classes/Gosu.src/M000008.html +0 -0
  50. data/reference/rdoc/classes/Gosu.src/M000009.html +0 -0
  51. data/reference/rdoc/classes/Gosu.src/M000010.html +0 -0
  52. data/reference/rdoc/classes/Gosu.src/M000011.html +0 -0
  53. data/reference/rdoc/classes/Gosu.src/M000012.html +0 -0
  54. data/reference/rdoc/classes/Gosu/Color.src/M000016.html +0 -0
  55. data/reference/rdoc/classes/Gosu/Color.src/M000017.html +0 -0
  56. data/reference/rdoc/classes/Gosu/Color.src/M000018.html +0 -0
  57. data/reference/rdoc/classes/Gosu/Color.src/M000019.html +0 -0
  58. data/reference/rdoc/classes/Gosu/Font.src/M000029.html +0 -0
  59. data/reference/rdoc/classes/Gosu/Font.src/M000030.html +0 -0
  60. data/reference/rdoc/classes/Gosu/Font.src/M000031.html +0 -0
  61. data/reference/rdoc/classes/Gosu/Font.src/M000032.html +0 -0
  62. data/reference/rdoc/classes/Gosu/Font.src/M000033.html +0 -0
  63. data/reference/rdoc/classes/Gosu/Image.src/M000020.html +0 -0
  64. data/reference/rdoc/classes/Gosu/Image.src/M000021.html +0 -0
  65. data/reference/rdoc/classes/Gosu/Image.src/M000022.html +0 -0
  66. data/reference/rdoc/classes/Gosu/Image.src/M000023.html +0 -0
  67. data/reference/rdoc/classes/Gosu/Image.src/M000024.html +0 -0
  68. data/reference/rdoc/classes/Gosu/Image.src/M000025.html +0 -0
  69. data/reference/rdoc/classes/Gosu/Image.src/M000026.html +0 -0
  70. data/reference/rdoc/classes/Gosu/Image.src/M000027.html +0 -0
  71. data/reference/rdoc/classes/Gosu/Image.src/M000028.html +0 -0
  72. data/reference/rdoc/classes/Gosu/Sample.src/M000013.html +0 -0
  73. data/reference/rdoc/classes/Gosu/Sample.src/M000014.html +0 -0
  74. data/reference/rdoc/classes/Gosu/Sample.src/M000015.html +0 -0
  75. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000051.html +0 -0
  76. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000052.html +0 -0
  77. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000053.html +0 -0
  78. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000054.html +0 -0
  79. data/reference/rdoc/classes/Gosu/SampleInstance.src/M000055.html +0 -0
  80. data/reference/rdoc/classes/Gosu/Song.src/M000056.html +0 -0
  81. data/reference/rdoc/classes/Gosu/Song.src/M000057.html +0 -0
  82. data/reference/rdoc/classes/Gosu/Song.src/M000058.html +0 -0
  83. data/reference/rdoc/classes/Gosu/Song.src/M000059.html +0 -0
  84. data/reference/rdoc/classes/Gosu/Song.src/M000060.html +0 -0
  85. data/reference/rdoc/classes/Gosu/Song.src/M000061.html +0 -0
  86. data/reference/rdoc/classes/Gosu/Song.src/M000062.html +0 -0
  87. data/reference/rdoc/classes/Gosu/Window.src/M000034.html +0 -0
  88. data/reference/rdoc/classes/Gosu/Window.src/M000035.html +0 -0
  89. data/reference/rdoc/classes/Gosu/Window.src/M000036.html +0 -0
  90. data/reference/rdoc/classes/Gosu/Window.src/M000037.html +0 -0
  91. data/reference/rdoc/classes/Gosu/Window.src/M000038.html +0 -0
  92. data/reference/rdoc/classes/Gosu/Window.src/M000039.html +0 -0
  93. data/reference/rdoc/classes/Gosu/Window.src/M000040.html +0 -0
  94. data/reference/rdoc/classes/Gosu/Window.src/M000041.html +0 -0
  95. data/reference/rdoc/classes/Gosu/Window.src/M000042.html +0 -0
  96. data/reference/rdoc/classes/Gosu/Window.src/M000043.html +0 -0
  97. data/reference/rdoc/classes/Gosu/Window.src/M000044.html +0 -0
  98. data/reference/rdoc/classes/Gosu/Window.src/M000045.html +0 -0
  99. data/reference/rdoc/classes/Gosu/Window.src/M000046.html +0 -0
  100. data/reference/rdoc/classes/Gosu/Window.src/M000047.html +0 -0
  101. data/reference/rdoc/classes/Gosu/Window.src/M000048.html +0 -0
  102. data/reference/rdoc/classes/Gosu/Window.src/M000049.html +0 -0
  103. data/reference/rdoc/classes/Gosu/Window.src/M000050.html +0 -0
  104. data/reference/rdoc/classes/Numeric.src/M000001.html +0 -0
  105. 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
data/examples/CptnRuby.rb CHANGED
@@ -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
data/examples/Tutorial.rb CHANGED
@@ -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
data/lib/gosu.rb CHANGED
@@ -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
data/lib/hotgosu.rb ADDED
@@ -0,0 +1,59 @@
1
+ require "#{File.dirname(__FILE__)}/hotgosu/constants.rb"
2
+ require "#{File.dirname(__FILE__)}/hotgosu/color.rb"
3
+ require "#{File.dirname(__FILE__)}/hotgosu/functions.rb"
4
+ require "#{File.dirname(__FILE__)}/hotgosu/font.rb"
5
+ require "#{File.dirname(__FILE__)}/hotgosu/image.rb"
6
+ require "#{File.dirname(__FILE__)}/hotgosu/sample.rb"
7
+ require "#{File.dirname(__FILE__)}/hotgosu/song.rb"
8
+ require "#{File.dirname(__FILE__)}/hotgosu/window.rb"
9
+ require "#{File.dirname(__FILE__)}/hotgosu/window_primitives.rb"
10
+
11
+ module Gosu
12
+ # # An instance of a Sample playing. Can be used to stop sounds dynamically,
13
+ # # or to check if they are finished.
14
+ # # It is recommended that you throw away sample instances if possible,
15
+ # # as they could accidentally refer to other sounds being played after
16
+ # # a very long time has passed.
17
+ # class SampleInstance
18
+ # attr_accessor :volume
19
+ # attr_accessor :speed
20
+ # attr_accessor :pan
21
+ #
22
+ # # Stops this instance of a sound being played. Calling this twice, or too late, does not do any harm. You can nil out the reference to the instance afterwards as it will be useless.
23
+ # def stop; end
24
+ # # Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused.
25
+ # def pause; end
26
+ # def paused?; end
27
+ # def resume; end
28
+ # def playing?; end
29
+ # end
30
+ #
31
+ # # TextInput instances are invisible objects that build a text string from input,
32
+ # # using the current operating system's keyboard layout.
33
+ # #
34
+ # # At its most basic form, you only need to create a new TextInput instance and
35
+ # # pass it to your window via text_input=. Until you call this function again,
36
+ # # passing nil, the TextInput object will build a text that can be accessed via
37
+ # # TextInput#text.
38
+ # #
39
+ # # A TextInput object is purely abstract, though; drawing the input field is left
40
+ # # to the user. As with most of Gosu, how this is handled is completely left open.
41
+ # #
42
+ # # TextInput only aims to provide enough code for your own GUIs to build upon.
43
+ # class TextInput
44
+ # attr_accessor :text
45
+ # attr_reader :caret_pos
46
+ # attr_reader :selection_start
47
+ # end
48
+
49
+
50
+ # Small additions to Numeric to make it easier to integrate Gosu with
51
+ # libraries that use radians, like Chipmunk.
52
+ class ::Numeric
53
+ # Returns <tt>self * 180.0 / Math::PI + 90</tt>
54
+ def radians_to_gosu(); end
55
+
56
+ # Returns <tt>(self - 90) * Math::PI / 180.0</tt>
57
+ def gosu_to_radians(); end
58
+ end
59
+ end
@@ -0,0 +1,43 @@
1
+ module Gosu
2
+ Color = ::ObjGosuColor
3
+
4
+ class Color
5
+ def self.new(*args)
6
+ case args.length
7
+ when 1 then
8
+ alloc.initWithARGB args[0]
9
+ when 4 then
10
+ alloc.initWithAlpha args[0], red: args[1], green: args[2], blue: args[3]
11
+ else
12
+ raise ArgumentError.new("wrong number of arguments (#{args.length} for 1 or 4)")
13
+ end
14
+ end
15
+ end
16
+
17
+ # # Represents an ARGB color value with 8 bits for each channel. Can be
18
+ # # replaced by literals of the form 0xaarrggbb in all of Gosu.
19
+ # class Color
20
+ # attr_accessor :hue, :saturation, :value
21
+ #
22
+ # # argb: 0xAARRGGBB integer.
23
+ # def initialize(argb); end
24
+ # # a:: Integer from 0..255
25
+ # # r:: Integer from 0..255
26
+ # # g:: Integer from 0..255
27
+ # # b:: Integer from 0..255
28
+ # def initialize(a, r, g, b); end
29
+ #
30
+ # # Converts a HSV triple into a color. Same as from_ahsv with alpha set to 255.
31
+ # # h:: Integer from 0..360
32
+ # # s:: Float from 0..1
33
+ # # v:: Float from 0..1.
34
+ # def self.from_hsv(h, s, v); end
35
+ #
36
+ # # Converts a HSV triple into a color, with a given alpha.
37
+ # # a:: Integer from 0..255
38
+ # # h:: Integer from 0..360
39
+ # # s:: Float from 0..1
40
+ # # v:: Float from 0..1.
41
+ # def self.from_ahsv(a, h, s, v); end
42
+ # end
43
+ end
@@ -0,0 +1,143 @@
1
+ # Mac-specific constants extracted from SWIG port via:
2
+
3
+ # Gosu.constants.sort.each do |name|
4
+ # value = eval "Gosu::#{name}"
5
+ # puts " #{name} = #{value.inspect}" unless value.is_a? Module
6
+ # end
7
+
8
+ module Gosu
9
+ GpButton0 = 65546
10
+ GpButton1 = 65547
11
+ GpButton10 = 65556
12
+ GpButton11 = 65557
13
+ GpButton12 = 65558
14
+ GpButton13 = 65559
15
+ GpButton14 = 65560
16
+ GpButton15 = 65561
17
+ GpButton2 = 65548
18
+ GpButton3 = 65549
19
+ GpButton4 = 65550
20
+ GpButton5 = 65551
21
+ GpButton6 = 65552
22
+ GpButton7 = 65553
23
+ GpButton8 = 65554
24
+ GpButton9 = 65555
25
+ GpDown = 65545
26
+ GpLeft = 65542
27
+ GpNum = 20
28
+ GpRangeBegin = 65542
29
+ GpRangeEnd = 65561
30
+ GpRight = 65543
31
+ GpUp = 65544
32
+ Kb0 = 29
33
+ Kb1 = 18
34
+ Kb2 = 19
35
+ Kb3 = 20
36
+ Kb4 = 21
37
+ Kb5 = 23
38
+ Kb6 = 22
39
+ Kb7 = 26
40
+ Kb8 = 28
41
+ Kb9 = 25
42
+ KbA = 0
43
+ KbB = 11
44
+ KbBackspace = 51
45
+ KbC = 8
46
+ KbD = 2
47
+ KbDelete = 117
48
+ KbDown = 125
49
+ KbE = 14
50
+ KbEnd = 119
51
+ KbEnter = 76
52
+ KbEscape = 53
53
+ KbF = 3
54
+ KbF1 = 122
55
+ KbF10 = 109
56
+ KbF11 = 103
57
+ KbF12 = 111
58
+ KbF2 = 120
59
+ KbF3 = 99
60
+ KbF4 = 118
61
+ KbF5 = 96
62
+ KbF6 = 97
63
+ KbF7 = 98
64
+ KbF8 = 100
65
+ KbF9 = 101
66
+ KbG = 5
67
+ KbH = 4
68
+ KbHome = 115
69
+ KbI = 34
70
+ KbInsert = 114
71
+ KbJ = 38
72
+ KbK = 40
73
+ KbL = 37
74
+ KbLeft = 123
75
+ KbLeftAlt = 58
76
+ KbLeftControl = 59
77
+ KbLeftMeta = 55
78
+ KbLeftShift = 56
79
+ KbM = 46
80
+ KbN = 45
81
+ KbNum = 65535
82
+ KbNumpad0 = 82
83
+ KbNumpad1 = 83
84
+ KbNumpad2 = 84
85
+ KbNumpad3 = 85
86
+ KbNumpad4 = 86
87
+ KbNumpad5 = 87
88
+ KbNumpad6 = 88
89
+ KbNumpad7 = 89
90
+ KbNumpad8 = 91
91
+ KbNumpad9 = 92
92
+ KbNumpadAdd = 69
93
+ KbNumpadDivide = 75
94
+ KbNumpadMultiply = 67
95
+ KbNumpadSubtract = 78
96
+ KbO = 31
97
+ KbP = 35
98
+ KbPageDown = 121
99
+ KbPageUp = 116
100
+ KbQ = 12
101
+ KbR = 15
102
+ KbRangeBegin = 1
103
+ KbRangeEnd = 65535
104
+ KbReturn = 36
105
+ KbRight = 124
106
+ KbRightAlt = 61
107
+ KbRightControl = 62
108
+ KbRightMeta = 54
109
+ KbRightShift = 60
110
+ KbS = 1
111
+ KbSpace = 49
112
+ KbT = 17
113
+ KbTab = 48
114
+ KbU = 32
115
+ KbUp = 126
116
+ KbV = 9
117
+ KbW = 13
118
+ KbX = 7
119
+ KbY = 16
120
+ KbZ = 6
121
+ MAJOR_VERSION = 0
122
+ MINOR_VERSION = 7
123
+ MsLeft = 65536
124
+ MsMiddle = 65538
125
+ MsNum = 6
126
+ MsRangeBegin = 65536
127
+ MsRangeEnd = 65541
128
+ MsRight = 65537
129
+ MsWheelDown = 65540
130
+ MsWheelUp = 65539
131
+ NoButton = -1
132
+ NumButtons = 65562
133
+ POINT_VERSION = 16
134
+ VERSION = "0.7.16"
135
+ end
136
+
137
+ module Gosu
138
+ module Button
139
+ Gosu.constants.grep(/^(Gp|Ms|Kb)/).each do |constant|
140
+ self.const_set constant, Gosu.const_get(constant)
141
+ end
142
+ end
143
+ end