gosu 0.11.1.pre1 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gosu/Math.hpp +1 -1
- data/Gosu/Window.hpp +8 -4
- data/lib/gosu/patches.rb +5 -2
- data/rdoc/gosu.rb +130 -134
- data/src/Bitmap.cpp +1 -1
- data/src/Graphics.cpp +1 -1
- data/src/RubyGosu.cxx +15 -14
- data/src/TextWin.cpp +2 -2
- data/src/Window.cpp +42 -14
- data/src/WindowUIKit.cpp +4 -0
- data/src/stb_image.h +173 -384
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a831194f9c3424b3866b28db95100d56da1621
|
4
|
+
data.tar.gz: e98300b664a62ff75bfe6de59542c779d939241e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66d9c21c663b3bba6bbb48f6c2860c3075a75ebc0f77216a42251c851380dedcbb5a10da7479196b652d52ab138996bafaaaa3ff7e5ed4ec7c1b75f77190c347
|
7
|
+
data.tar.gz: ebd17c6adcfbc3b6bbfe7f63b18085273c430b18806148e77468ba5cca41ef290d49e35820681c919276351a6fda29e5ccea3dc67b89c9de9bb6acbc527401f7
|
data/Gosu/Math.hpp
CHANGED
data/Gosu/Window.hpp
CHANGED
@@ -97,17 +97,21 @@ namespace Gosu
|
|
97
97
|
virtual bool needs_cursor() const { return false; }
|
98
98
|
|
99
99
|
//! This function is called when the window loses focus on some platforms.
|
100
|
-
//! Most importantly, it is called on the
|
100
|
+
//! Most importantly, it is called on the iPhone or iPad when the user locks the screen.
|
101
101
|
virtual void lose_focus() {}
|
102
102
|
|
103
103
|
//! This function is called when the operating system's memory is low.
|
104
104
|
//! So far, it is only called in iOS applications.
|
105
105
|
virtual void release_memory() {}
|
106
106
|
|
107
|
-
//! Called before update when the user
|
108
|
-
|
107
|
+
//! Called before update when the user presses a button while the window has the focus.
|
108
|
+
//! By default, this will toggle fullscreen mode if the user presses alt+enter (Windows,
|
109
|
+
//! Linux) or cmd+F (macOS).
|
110
|
+
//! To support these shortcuts in your application, make sure to call Window::button_down
|
111
|
+
//! in your implementation.
|
112
|
+
virtual void button_down(Gosu::Button);
|
109
113
|
|
110
|
-
//! Same as button_down. Called then the user
|
114
|
+
//! Same as button_down. Called then the user releases a button.
|
111
115
|
virtual void button_up(Gosu::Button) {}
|
112
116
|
|
113
117
|
// Ignore when SWIG is wrapping this class for Ruby/Gosu.
|
data/lib/gosu/patches.rb
CHANGED
@@ -159,6 +159,9 @@ Gosu::GOSU_COPYRIGHT_NOTICE = Gosu::LICENSES
|
|
159
159
|
|
160
160
|
# Release OpenAL resources during Ruby's shutdown, not Gosu's.
|
161
161
|
at_exit do
|
162
|
-
|
163
|
-
|
162
|
+
begin
|
163
|
+
Gosu::Song.current_song.stop if Gosu::Song.current_song
|
164
|
+
Gosu._release_all_openal_resources
|
165
|
+
rescue
|
166
|
+
end
|
164
167
|
end
|
data/rdoc/gosu.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
+
# Encoding: UTF-8
|
2
|
+
|
1
3
|
module Gosu
|
2
4
|
##
|
3
5
|
# The first component of the version.
|
4
|
-
MAJOR_VERSION = :
|
6
|
+
MAJOR_VERSION = :an_integer
|
5
7
|
|
6
8
|
##
|
7
9
|
# The second component of the version.
|
8
|
-
MINOR_VERSION = :
|
10
|
+
MINOR_VERSION = :an_integer
|
9
11
|
|
10
12
|
##
|
11
13
|
# The third component of the version.
|
12
|
-
POINT_VERSION = :
|
14
|
+
POINT_VERSION = :an_integer
|
13
15
|
|
14
16
|
##
|
15
17
|
# A version string of the form "0.1.2", "0.1.2.3" or "0.1.2pre4".
|
@@ -23,114 +25,99 @@ module Gosu
|
|
23
25
|
# A block of legal copy that your game is obliged to display somewhere.
|
24
26
|
LICENSES = :a_string
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
KB_0…KB_9 = :an_integer
|
29
|
+
KB_A…KB_Z = :an_integer
|
30
|
+
KB_APOSTROPHE = :an_integer
|
31
|
+
KB_BACKSLASH = :an_integer
|
32
|
+
KB_BACKSPACE = :an_integer
|
33
|
+
KB_BACKTICK = :an_integer
|
34
|
+
KB_COMMA = :an_integer
|
35
|
+
KB_DELETE = :an_integer
|
36
|
+
KB_DOWN = :an_integer
|
37
|
+
KB_END = :an_integer
|
32
38
|
|
33
39
|
##
|
34
40
|
# This is the key on the numpad.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
KB_ENTER = :an_integer
|
42
|
+
|
43
|
+
KB_EQUALS = :an_integer
|
44
|
+
KB_ESCAPE = :an_integer
|
45
|
+
KB_F1…KB_F12 = :an_integer
|
46
|
+
KB_HOME = :an_integer
|
47
|
+
KB_INSERT = :an_integer
|
48
|
+
KB_ISO = :an_integer
|
49
|
+
KB_LEFT = :an_integer
|
50
|
+
KB_LEFT_ALT = :an_integer
|
51
|
+
KB_LEFT_BRACKET = :an_integer
|
52
|
+
KB_LEFT_CONTROL = :an_integer
|
53
|
+
KB_LEFT_META = :an_integer
|
54
|
+
KB_LEFT_SHIFT = :an_integer
|
55
|
+
KB_MINUS = :an_integer
|
56
|
+
KB_NUMPAD_0…KB_NUMPAD_9 = :an_integer
|
57
|
+
KB_NUMPAD_DIVIDE = :an_integer
|
58
|
+
KB_NUMPAD_MINUS = :an_integer
|
59
|
+
KB_NUMPAD_MULTIPLY = :an_integer
|
60
|
+
KB_NUMPAD_PLUS = :an_integer
|
61
|
+
KB_PAGE_DOWN = :an_integer
|
62
|
+
KB_PAGE_UP = :an_integer
|
63
|
+
KB_PERIOD = :an_integer
|
52
64
|
|
53
65
|
##
|
54
66
|
# This is the key above the right shift key.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
GpUp = :implementation_defined
|
88
|
-
|
89
|
-
Gp0Button0 Gp0Button1 Gp0Button2 Gp0Button3 Gp0Button4 Gp0Button5 Gp0Button6 Gp0Button7 Gp0Button8 Gp0Button9 Gp0Button10 Gp0Button11 Gp0Button12 Gp0Button13 Gp0Button14 Gp0Button15 = :implementation_defined
|
90
|
-
Gp0Down = :implementation_defined
|
91
|
-
Gp0Left = :implementation_defined
|
92
|
-
Gp0Right = :implementation_defined
|
93
|
-
Gp0Up = :implementation_defined
|
94
|
-
|
95
|
-
Gp1Button0 Gp1Button1 Gp1Button2 Gp1Button3 Gp1Button4 Gp1Button5 Gp1Button6 Gp1Button7 Gp1Button8 Gp1Button9 Gp1Button10 Gp1Button11 Gp1Button12 Gp1Button13 Gp1Button14 Gp1Button15 = :implementation_defined
|
96
|
-
Gp1Down = :implementation_defined
|
97
|
-
Gp1Left = :implementation_defined
|
98
|
-
Gp1Right = :implementation_defined
|
99
|
-
Gp1Up = :implementation_defined
|
100
|
-
|
101
|
-
Gp2Button0 Gp2Button1 Gp2Button2 Gp2Button3 Gp2Button4 Gp2Button5 Gp2Button6 Gp2Button7 Gp2Button8 Gp2Button9 Gp2Button10 Gp2Button11 Gp2Button12 Gp2Button13 Gp2Button14 Gp2Button15 = :implementation_defined
|
102
|
-
Gp2Down = :implementation_defined
|
103
|
-
Gp2Left = :implementation_defined
|
104
|
-
Gp2Right = :implementation_defined
|
105
|
-
Gp2Up = :implementation_defined
|
106
|
-
|
107
|
-
Gp3Button0 Gp3Button1 Gp3Button2 Gp3Button3 Gp3Button4 Gp3Button5 Gp3Button6 Gp3Button7 Gp3Button8 Gp3Button9 Gp3Button10 Gp3Button11 Gp3Button12 Gp3Button13 Gp3Button14 Gp3Button15 = :implementation_defined
|
108
|
-
Gp3Down = :implementation_defined
|
109
|
-
Gp3Left = :implementation_defined
|
110
|
-
Gp3Right = :implementation_defined
|
111
|
-
Gp3Up = :implementation_defined
|
67
|
+
KB_RETURN = :an_integer
|
68
|
+
|
69
|
+
KB_RIGHT = :an_integer
|
70
|
+
KB_RIGHT_ALT = :an_integer
|
71
|
+
KB_RIGHT_BRACKET = :an_integer
|
72
|
+
KB_RIGHT_CONTROL = :an_integer
|
73
|
+
KB_RIGHT_META = :an_integer
|
74
|
+
KB_RIGHT_SHIFT = :an_integer
|
75
|
+
KB_SEMICOLON = :an_integer
|
76
|
+
KB_SLASH = :an_integer
|
77
|
+
KB_SPACE = :an_integer
|
78
|
+
KB_TAB = :an_integer
|
79
|
+
KB_UP = :an_integer
|
80
|
+
|
81
|
+
MS_LEFT = :an_integer
|
82
|
+
MS_MIDDLE = :an_integer
|
83
|
+
MS_RIGHT = :an_integer
|
84
|
+
MS_WHEEL_DOWN = :an_integer
|
85
|
+
MS_WHEEL_UP = :an_integer
|
86
|
+
MS_OTHER_0…MS_OTHER_7 = :an_integer
|
87
|
+
|
88
|
+
GP_BUTTON_0…GP_BUTTON_15 = :an_integer
|
89
|
+
GP_DOWN = :an_integer
|
90
|
+
GP_LEFT = :an_integer
|
91
|
+
GP_RIGHT = :an_integer
|
92
|
+
GP_UP = :an_integer
|
93
|
+
|
94
|
+
GP_0_BUTTON_0…GP_3_BUTTON_15 = :an_integer
|
95
|
+
GP_0_DOWN…GP_3_DOWN = :an_integer
|
96
|
+
GP_0_LEFT…GP_3_LEFT = :an_integer
|
97
|
+
GP_0_RIGHT…GP_3_RIGHT = :an_integer
|
98
|
+
GP_0_UP…GP_3_UP = :an_integer
|
112
99
|
|
113
100
|
##
|
114
101
|
# Represents an ARGB color value with 8 bits for each channel. Colors can be used interchangeably with integer literals of the form 0xAARRGGBB in all Gosu APIs.
|
115
102
|
class Color
|
116
103
|
##
|
117
|
-
# @return [
|
104
|
+
# @return [Integer] the color's alpha channel.
|
118
105
|
attr_accessor :alpha
|
119
106
|
|
120
107
|
##
|
121
|
-
# @return [
|
108
|
+
# @return [Integer] the color's red channel.
|
122
109
|
attr_accessor :red
|
123
110
|
|
124
111
|
##
|
125
|
-
# @return [
|
112
|
+
# @return [Integer] the color's green channel.
|
126
113
|
attr_accessor :green
|
127
114
|
|
128
115
|
##
|
129
|
-
# @return [
|
116
|
+
# @return [Integer] the color's blue channel.
|
130
117
|
attr_accessor :blue
|
131
118
|
|
132
119
|
##
|
133
|
-
# @return [
|
120
|
+
# @return [Integer] the color's hue in the range (0...360).
|
134
121
|
attr_accessor :hue
|
135
122
|
|
136
123
|
##
|
@@ -145,13 +132,13 @@ module Gosu
|
|
145
132
|
|
146
133
|
##
|
147
134
|
# @overload initialize(argb)
|
148
|
-
# @param argb [
|
135
|
+
# @param argb [Integer] an integer of the form 0xAARRGGBB.
|
149
136
|
#
|
150
137
|
# @overload initialize(a, r, g, b)
|
151
|
-
# @param a [
|
152
|
-
# @param r [
|
153
|
-
# @param g [
|
154
|
-
# @param b [
|
138
|
+
# @param a [Integer] the color's alpha channel in the range (0..255).
|
139
|
+
# @param r [Integer] the color's red channel in the range (0..255).
|
140
|
+
# @param g [Integer] the color's green channel in the range (0..255).
|
141
|
+
# @param b [Integer] the color's blue channel in the range (0..255).
|
155
142
|
#
|
156
143
|
# @see from_hsv
|
157
144
|
# @see from_ahsv
|
@@ -163,13 +150,13 @@ module Gosu
|
|
163
150
|
# @return (see #initialize)
|
164
151
|
#
|
165
152
|
# @overload rgba(rgba)
|
166
|
-
# @param argb [
|
153
|
+
# @param argb [Integer] an integer of the form 0xRRGGBBAA.
|
167
154
|
#
|
168
155
|
# @overload rgba(r, g, b, a)
|
169
|
-
# @param r [
|
170
|
-
# @param g [
|
171
|
-
# @param b [
|
172
|
-
# @param a [
|
156
|
+
# @param r [Integer] the color's red channel in the range (0..255).
|
157
|
+
# @param g [Integer] the color's green channel in the range (0..255).
|
158
|
+
# @param b [Integer] the color's blue channel in the range (0..255).
|
159
|
+
# @param a [Integer] the color's alpha channel in the range (0..255).
|
173
160
|
#
|
174
161
|
# @see #initialize
|
175
162
|
# @see argb
|
@@ -188,7 +175,7 @@ module Gosu
|
|
188
175
|
# Converts an HSV triplet to an opaque color.
|
189
176
|
#
|
190
177
|
# @return [Color] a color corresponding to the HSV triplet.
|
191
|
-
# @param h [
|
178
|
+
# @param h [Integer] the color's hue in the range (0..360).
|
192
179
|
# @param s [Float] the color's saturation in the range (0..1).
|
193
180
|
# @param v [Float] the color's value in the range (0..1).
|
194
181
|
#
|
@@ -198,7 +185,7 @@ module Gosu
|
|
198
185
|
# Converts an HSV triplet to a color with the alpha channel set to a given value.
|
199
186
|
#
|
200
187
|
# @return (see from_hsv)
|
201
|
-
# @param a [
|
188
|
+
# @param a [Integer] the color's opacity in the range (0..255).
|
202
189
|
# @param (see from_hsv)
|
203
190
|
#
|
204
191
|
# @see from_hsv
|
@@ -208,7 +195,7 @@ module Gosu
|
|
208
195
|
|
209
196
|
# Returns a 32-bit representation of the color suitable for use with OpenGL calls. This color is stored in a fixed order in memory and its integer value may vary depending on your system's byte order.
|
210
197
|
#
|
211
|
-
# @return [
|
198
|
+
# @return [Integer] a 32-bit OpenGL color.
|
212
199
|
def gl; end
|
213
200
|
|
214
201
|
##
|
@@ -240,7 +227,7 @@ module Gosu
|
|
240
227
|
attr_reader :name
|
241
228
|
|
242
229
|
##
|
243
|
-
# @return [
|
230
|
+
# @return [Integer] the font's height in pixels.
|
244
231
|
attr_reader :height
|
245
232
|
|
246
233
|
##
|
@@ -248,7 +235,7 @@ module Gosu
|
|
248
235
|
#
|
249
236
|
# (Passing a Window reference is not necessary anymore, please use the first overload from now on.)
|
250
237
|
#
|
251
|
-
# @param height [
|
238
|
+
# @param height [Integer] the height of the font, in pixels.
|
252
239
|
# @param [Hash] options
|
253
240
|
# @option options [String] :name the name of a system font, or a path to a TrueType Font (TTF) file. A path must contain at least one '/' character to distinguish it from a system font.
|
254
241
|
#
|
@@ -278,7 +265,7 @@ module Gosu
|
|
278
265
|
# @param z [Number] the Z-order.
|
279
266
|
# @param scale_x [Float] the horizontal scaling factor.
|
280
267
|
# @param scale_y [Float] the vertical scaling factor.
|
281
|
-
# @param color [Color,
|
268
|
+
# @param color [Color, Integer]
|
282
269
|
# @param mode [:default, :additive] the blending mode to use.
|
283
270
|
#
|
284
271
|
# @see #draw_rel
|
@@ -316,7 +303,7 @@ module Gosu
|
|
316
303
|
##
|
317
304
|
# Returns the width of a single line of text, in pixels, if it were drawn.
|
318
305
|
#
|
319
|
-
# @return [
|
306
|
+
# @return [Integer] the width of the text, in pixels.
|
320
307
|
# @param text [String]
|
321
308
|
def text_width(text, scale_x=1); end
|
322
309
|
end
|
@@ -325,11 +312,11 @@ module Gosu
|
|
325
312
|
# Provides functionality for drawing rectangular images.
|
326
313
|
class Image
|
327
314
|
##
|
328
|
-
# @return [
|
315
|
+
# @return [Integer] the image's width, in pixels.
|
329
316
|
attr_reader :width
|
330
317
|
|
331
318
|
##
|
332
|
-
# @return [
|
319
|
+
# @return [Integer] the image's height, in pixels.
|
333
320
|
attr_reader :height
|
334
321
|
|
335
322
|
# @!group Creating and loading images
|
@@ -369,11 +356,11 @@ module Gosu
|
|
369
356
|
#
|
370
357
|
# @return [Gosu::Image]
|
371
358
|
# @param [String] text
|
372
|
-
# @param [
|
359
|
+
# @param [Integer] line_height the line height, in pixels.
|
373
360
|
# @param [Hash] options
|
374
361
|
# @option options [String] :font (Gosu::default_font_name) the name of a system font, or a path to a TrueType Font (TTF) file. A path must contain at least one '/' character to distinguish it from a system font.
|
375
|
-
# @option options [
|
376
|
-
# @option options [
|
362
|
+
# @option options [Integer] :width the width of the image, in pixels. Long lines will be automatically wrapped around to avoid overflow, but overlong words will be truncated. If this option is omitted, lines will not be wrapped, and :align and :spacing will be ignored as well.
|
363
|
+
# @option options [Integer] :spacing (0) the spacing between lines, in pixels.
|
377
364
|
# @option options [:left, :right, :center, :justify] :align (:left) the text alignment.
|
378
365
|
# @option options [true, false] :retro (false) if true, the image will not be interpolated when it is scaled up or down.
|
379
366
|
#
|
@@ -388,8 +375,8 @@ module Gosu
|
|
388
375
|
#
|
389
376
|
# @return [Array<Gosu::Image>]
|
390
377
|
# @param source [String, Magick::Image]
|
391
|
-
# @param tile_width [
|
392
|
-
# @param tile_height [
|
378
|
+
# @param tile_width [Integer] If positive, this is the width of the individual tiles; if negative, the image is divided into -tile_width columns.
|
379
|
+
# @param tile_height [Integer] If positive, this is the height of the individual tiles; if negative, the image is divided into -tile_height rows.
|
393
380
|
# @param [Hash] options
|
394
381
|
# @option options [true, false] :tileable (false) if true, the Image will not have soft edges when scaled
|
395
382
|
# @option options [true, false] :retro (false) if true, the image will not be interpolated when it is scaled up or down. When :retro it set, :tileable has no effect.
|
@@ -507,8 +494,8 @@ module Gosu
|
|
507
494
|
#
|
508
495
|
# @return [void]
|
509
496
|
# @param source [String, Magick::Image] the filename or RMagick image to load from.
|
510
|
-
# @param x [
|
511
|
-
# @param y [
|
497
|
+
# @param x [Integer] the X coordinate of the top left corner.
|
498
|
+
# @param y [Integer] the Y coordinate of the top left corner.
|
512
499
|
def insert(source, x, y); end
|
513
500
|
|
514
501
|
##
|
@@ -681,11 +668,11 @@ module Gosu
|
|
681
668
|
attr_accessor :text
|
682
669
|
|
683
670
|
##
|
684
|
-
# @return [
|
671
|
+
# @return [Integer] the position of the editing caret.
|
685
672
|
attr_accessor :caret_pos
|
686
673
|
|
687
674
|
##
|
688
|
-
# @return [
|
675
|
+
# @return [Integer] the starting position of the currently selected text.
|
689
676
|
attr_accessor :selection_start
|
690
677
|
|
691
678
|
##
|
@@ -739,18 +726,22 @@ module Gosu
|
|
739
726
|
##
|
740
727
|
# The window's width, in pixels. This only counts the drawable area and does not include any borders or decorations added by the window manager.
|
741
728
|
#
|
742
|
-
# @return [
|
729
|
+
# @return [Integer] the window's width, in pixels.
|
743
730
|
attr_accessor :width
|
744
731
|
|
745
732
|
##
|
746
733
|
# The window's height, in pixels. This only counts the drawable area and does not include any borders or decorations added by the window manager.
|
747
734
|
#
|
748
|
-
# @return [
|
735
|
+
# @return [Integer] the window's height, in pixels.
|
749
736
|
attr_accessor :height
|
750
737
|
|
751
738
|
##
|
752
|
-
# @return [true, false] whether this is a
|
753
|
-
|
739
|
+
# @return [true, false] whether this is a fullscreen window.
|
740
|
+
def fullscreen?; end
|
741
|
+
|
742
|
+
##
|
743
|
+
# Toggles between windowed mode and fullscreen.
|
744
|
+
attr_writer :fullscreen
|
754
745
|
|
755
746
|
##
|
756
747
|
# @return [Float] the interval between calls to {#update}, in milliseconds.
|
@@ -764,8 +755,8 @@ module Gosu
|
|
764
755
|
# @overload initialize(width, height, options = {})
|
765
756
|
# @overload initialize(width, height, fullscreen, update_interval = 16.666666)
|
766
757
|
#
|
767
|
-
# @param width [
|
768
|
-
# @param height [
|
758
|
+
# @param width [Integer] the desired window width.
|
759
|
+
# @param height [Integer] the desired window height.
|
769
760
|
# @param [Hash] options
|
770
761
|
# @option options [true, false] :fullscreen (false) whether to present the window in fullscreen mode.
|
771
762
|
# @option options [Float] :update_interval (16.666666) the interval between frames, in milliseconds.
|
@@ -828,17 +819,22 @@ module Gosu
|
|
828
819
|
def needs_cursor?; end
|
829
820
|
|
830
821
|
##
|
831
|
-
# This method is called before {#update} if a button
|
822
|
+
# This method is called before {#update} if a button is pressed while the window has focus.
|
823
|
+
#
|
824
|
+
# By default, this method will toggle fullscreen mode if the user presses alt+enter (Windows,
|
825
|
+
# Linux) or cmd+F (macOS).
|
826
|
+
# To support these shortcuts in your application, make sure to call super in your
|
827
|
+
# implementation.
|
832
828
|
#
|
833
829
|
# @return [void]
|
834
|
-
# @param id [
|
830
|
+
# @param id [Integer] the button's platform-defined id.
|
835
831
|
#
|
836
832
|
# @see #button_up
|
837
833
|
# @see Gosu.button_down?
|
838
834
|
def button_down(id); end
|
839
835
|
|
840
836
|
##
|
841
|
-
# This method is called before {#update} if a button
|
837
|
+
# This method is called before {#update} if a button is released while the window has focus.
|
842
838
|
#
|
843
839
|
# @return [void]
|
844
840
|
# @param (see #button_down)
|
@@ -863,7 +859,7 @@ module Gosu
|
|
863
859
|
# @see file:examples/OpenGLIntegration.rb
|
864
860
|
class GLTexInfo
|
865
861
|
##
|
866
|
-
# @return [
|
862
|
+
# @return [Integer] OpenGL texture id
|
867
863
|
attr_reader :tex_name
|
868
864
|
|
869
865
|
##
|
@@ -1127,7 +1123,7 @@ module Gosu
|
|
1127
1123
|
# @note For real text input, look at {TextInput} instead.
|
1128
1124
|
#
|
1129
1125
|
# @return [String?] the character the button usually produces.
|
1130
|
-
# @param id [
|
1126
|
+
# @param id [Integer] the button's platform-defined id.
|
1131
1127
|
#
|
1132
1128
|
# @see char_to_button_id
|
1133
1129
|
# @see Window#text_input
|
@@ -1137,7 +1133,7 @@ module Gosu
|
|
1137
1133
|
##
|
1138
1134
|
# Returns the button that usually produces a character, if any.
|
1139
1135
|
#
|
1140
|
-
# @return [
|
1136
|
+
# @return [Integer?] the button that usually produces the character.
|
1141
1137
|
# @param char [String] the character to query.
|
1142
1138
|
#
|
1143
1139
|
# @see button_id_to_char
|
@@ -1188,11 +1184,11 @@ module Gosu
|
|
1188
1184
|
##
|
1189
1185
|
# @note For long-running games, this counter will eventually wrap around to 0 again.
|
1190
1186
|
#
|
1191
|
-
# @return [
|
1187
|
+
# @return [Integer] the number of milliseconds elapsed.
|
1192
1188
|
def milliseconds(); end
|
1193
1189
|
|
1194
1190
|
##
|
1195
|
-
# @return [
|
1191
|
+
# @return [Integer] the current framerate, in frames per second.
|
1196
1192
|
def fps(); end
|
1197
1193
|
|
1198
1194
|
# @return [String] the name of a neutral font that is available on the current platform.
|
@@ -1202,18 +1198,18 @@ module Gosu
|
|
1202
1198
|
def default_font_name(); end
|
1203
1199
|
|
1204
1200
|
##
|
1205
|
-
# @return [
|
1201
|
+
# @return [Integer] the width (in pixels) of the user's primary screen.
|
1206
1202
|
def screen_width(); end
|
1207
1203
|
|
1208
|
-
# @return [
|
1204
|
+
# @return [Integer] the height (in pixels) of the user's primary screen.
|
1209
1205
|
def screen_height(); end
|
1210
1206
|
|
1211
1207
|
##
|
1212
|
-
# @return [
|
1208
|
+
# @return [Integer] the maximum width (in 'points') that is available for a non-fullscreen Window.
|
1213
1209
|
# All windows larger than this size will automatically be shrunk to fit.
|
1214
1210
|
def available_width(); end
|
1215
1211
|
|
1216
|
-
# @return [
|
1212
|
+
# @return [Integer] the maximum height (in 'points') that is available for a non-fullscreen Window.
|
1217
1213
|
# All windows larger than this size will automatically be shrunk to fit.
|
1218
1214
|
def available_height(); end
|
1219
1215
|
|