rubygame 2.2.0-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/CREDITS +60 -0
  2. data/LICENSE +504 -0
  3. data/NEWS +201 -0
  4. data/README +139 -0
  5. data/ROADMAP +43 -0
  6. data/Rakefile +409 -0
  7. data/doc/extended_readme.rdoc +49 -0
  8. data/doc/getting_started.rdoc +47 -0
  9. data/doc/macosx_install.rdoc +70 -0
  10. data/doc/windows_install.rdoc +127 -0
  11. data/ext/rubygame/MANIFEST +25 -0
  12. data/ext/rubygame/rubygame_core.so +0 -0
  13. data/ext/rubygame/rubygame_event.c +644 -0
  14. data/ext/rubygame/rubygame_event.h +48 -0
  15. data/ext/rubygame/rubygame_event.obj +0 -0
  16. data/ext/rubygame/rubygame_gfx.c +942 -0
  17. data/ext/rubygame/rubygame_gfx.h +101 -0
  18. data/ext/rubygame/rubygame_gfx.obj +0 -0
  19. data/ext/rubygame/rubygame_gfx.so +0 -0
  20. data/ext/rubygame/rubygame_gl.c +154 -0
  21. data/ext/rubygame/rubygame_gl.h +32 -0
  22. data/ext/rubygame/rubygame_gl.obj +0 -0
  23. data/ext/rubygame/rubygame_image.c +108 -0
  24. data/ext/rubygame/rubygame_image.h +41 -0
  25. data/ext/rubygame/rubygame_image.obj +0 -0
  26. data/ext/rubygame/rubygame_image.so +0 -0
  27. data/ext/rubygame/rubygame_joystick.c +247 -0
  28. data/ext/rubygame/rubygame_joystick.h +41 -0
  29. data/ext/rubygame/rubygame_joystick.obj +0 -0
  30. data/ext/rubygame/rubygame_main.c +155 -0
  31. data/ext/rubygame/rubygame_main.h +33 -0
  32. data/ext/rubygame/rubygame_main.obj +0 -0
  33. data/ext/rubygame/rubygame_mixer.c +764 -0
  34. data/ext/rubygame/rubygame_mixer.h +62 -0
  35. data/ext/rubygame/rubygame_mixer.obj +0 -0
  36. data/ext/rubygame/rubygame_mixer.so +0 -0
  37. data/ext/rubygame/rubygame_screen.c +448 -0
  38. data/ext/rubygame/rubygame_screen.h +43 -0
  39. data/ext/rubygame/rubygame_screen.obj +0 -0
  40. data/ext/rubygame/rubygame_shared.c +209 -0
  41. data/ext/rubygame/rubygame_shared.h +60 -0
  42. data/ext/rubygame/rubygame_shared.obj +0 -0
  43. data/ext/rubygame/rubygame_surface.c +1147 -0
  44. data/ext/rubygame/rubygame_surface.h +62 -0
  45. data/ext/rubygame/rubygame_surface.obj +0 -0
  46. data/ext/rubygame/rubygame_time.c +183 -0
  47. data/ext/rubygame/rubygame_time.h +32 -0
  48. data/ext/rubygame/rubygame_time.obj +0 -0
  49. data/ext/rubygame/rubygame_ttf.c +599 -0
  50. data/ext/rubygame/rubygame_ttf.h +69 -0
  51. data/ext/rubygame/rubygame_ttf.obj +0 -0
  52. data/ext/rubygame/rubygame_ttf.so +0 -0
  53. data/lib/rubygame.rb +41 -0
  54. data/lib/rubygame/MANIFEST +12 -0
  55. data/lib/rubygame/clock.rb +128 -0
  56. data/lib/rubygame/color.rb +79 -0
  57. data/lib/rubygame/color/models/base.rb +106 -0
  58. data/lib/rubygame/color/models/hsl.rb +153 -0
  59. data/lib/rubygame/color/models/hsv.rb +149 -0
  60. data/lib/rubygame/color/models/rgb.rb +78 -0
  61. data/lib/rubygame/color/palettes/css.rb +49 -0
  62. data/lib/rubygame/color/palettes/palette.rb +100 -0
  63. data/lib/rubygame/color/palettes/x11.rb +177 -0
  64. data/lib/rubygame/constants.rb +238 -0
  65. data/lib/rubygame/event.rb +313 -0
  66. data/lib/rubygame/ftor.rb +370 -0
  67. data/lib/rubygame/hotspot.rb +265 -0
  68. data/lib/rubygame/keyconstants.rb +237 -0
  69. data/lib/rubygame/mediabag.rb +94 -0
  70. data/lib/rubygame/queue.rb +288 -0
  71. data/lib/rubygame/rect.rb +612 -0
  72. data/lib/rubygame/sfont.rb +223 -0
  73. data/lib/rubygame/sprite.rb +511 -0
  74. data/samples/FreeSans.ttf +0 -0
  75. data/samples/GPL.txt +340 -0
  76. data/samples/README +40 -0
  77. data/samples/chimp.bmp +0 -0
  78. data/samples/chimp.rb +313 -0
  79. data/samples/demo_gl.rb +151 -0
  80. data/samples/demo_gl_tex.rb +197 -0
  81. data/samples/demo_music.rb +75 -0
  82. data/samples/demo_rubygame.rb +284 -0
  83. data/samples/demo_sfont.rb +52 -0
  84. data/samples/demo_ttf.rb +193 -0
  85. data/samples/demo_utf8.rb +53 -0
  86. data/samples/fist.bmp +0 -0
  87. data/samples/load_and_blit.rb +22 -0
  88. data/samples/panda.png +0 -0
  89. data/samples/punch.wav +0 -0
  90. data/samples/ruby.png +0 -0
  91. data/samples/song.ogg +0 -0
  92. data/samples/term16.png +0 -0
  93. data/samples/whiff.wav +0 -0
  94. metadata +152 -0
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This program is PUBLIC DOMAIN.
4
+ # It is distributed in the hope that it will be useful,
5
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
6
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
+
8
+ require "rubygame"
9
+ require "rubygame/sfont"
10
+ include Rubygame
11
+
12
+ def main(*args)
13
+ font_name = ""
14
+
15
+ if args.length < 1
16
+ font_name = "term16.png"
17
+ puts <<EOF
18
+ You can pass the filename of a SFont-compatible font as the
19
+ first argument to try it, e.g.: ./demo_sfont.rb my_font.png
20
+
21
+ There are many sample fonts available online:
22
+ http://user.cs.tu-berlin.de/~karlb/sfont/fonts.html
23
+ EOF
24
+ else
25
+ font_name = args[0]
26
+ end
27
+
28
+ screen = Screen.set_mode([700,400])
29
+ queue = EventQueue.new()
30
+ queue.ignore = [ActiveEvent,MouseMotionEvent,MouseUpEvent,MouseDownEvent]
31
+
32
+
33
+ screen.title = "SFont Test (%s)"%font_name
34
+ font = SFont.new(font_name)
35
+ renders = []
36
+ renders << font.render("This font is: %s"%font_name)
37
+ renders << font.render("I say, \"I love pie!\"")
38
+ renders << font.render("I could eat #{Math::PI} pies.")
39
+ renders << font.render("0 1 2 3 4 5 6 7 8 9")
40
+ renders << font.render("!@\#$%^&*()[]{}<>;:/\\+=-_'`\"")
41
+ renders << font.render("abcdefghijklmnopqrstuvwxyz")
42
+ renders << font.render("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
43
+
44
+ (renders.length).times do |i|
45
+ renders[i].blit(screen,[10,10+font.height*i])
46
+ end
47
+ screen.update()
48
+
49
+ queue.wait()
50
+ end
51
+
52
+ main(*ARGV)
@@ -0,0 +1,193 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This program is PUBLIC DOMAIN.
4
+ # It is distributed in the hope that it will be useful,
5
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
6
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
+
8
+ require "rubygame"
9
+ include Rubygame
10
+ Rubygame.init()
11
+
12
+ def test_noaa_nobg(font,screen,y)
13
+ puts "No antialiasing, no background..."
14
+ text = font.render("No AA, no BG",false,[200,200,200])
15
+ text.blit(screen,[0,y])
16
+ end
17
+
18
+ def test_noaa_bg(font,screen,y)
19
+ puts "No antialiasing, background..."
20
+ text = font.render("No AA, BG",false,[200,200,200],[0,0,255])
21
+ text.blit(screen,[0,y])
22
+ end
23
+
24
+ def test_aa_nobg(font,screen,y)
25
+ puts "Antialiasing, no background..."
26
+ text = font.render("AA, no BG",true,[200,200,200])
27
+ text.blit(screen,[0,y])
28
+ end
29
+
30
+ def test_aa_bg(font,screen,y)
31
+ puts "Antialiasing, background..."
32
+ text = font.render("AA, BG",true,[200,200,200],[0,0,255])
33
+ text.blit(screen,[0,y])
34
+ end
35
+
36
+ def test_bold_noaa(font,screen,y)
37
+ puts "Bold, no antialiasing..."
38
+ font.bold = true
39
+ text = font.render("Bold, no AA",false,[200,200,200])
40
+ text.blit(screen,[0,y])
41
+ font.bold = false
42
+ end
43
+
44
+ def test_bold_aa(font,screen,y)
45
+ puts "Bold, antialiasing..."
46
+ font.bold = true
47
+ text = font.render("Bold, AA",true,[200,200,200])
48
+ text.blit(screen,[0,y])
49
+ font.bold = false
50
+ end
51
+
52
+ def test_italic_noaa(font,screen,y)
53
+ puts "Italic, no antialiasing..."
54
+ font.italic = true
55
+ text = font.render("Italic, no AA",false,[200,200,200])
56
+ text.blit(screen,[0,y])
57
+ font.italic = false
58
+ end
59
+
60
+ def test_italic_aa(font,screen,y)
61
+ puts "Italic, antialiasing..."
62
+ font.italic = true
63
+ text = font.render("Italic, AA",true,[200,200,200])
64
+ text.blit(screen,[0,y])
65
+ font.italic = false
66
+ end
67
+
68
+ def test_underline_noaa(font,screen,y)
69
+ puts "Underline, no antialiasing..."
70
+ font.underline = true
71
+ text = font.render("Underline, no AA",false,[200,200,200])
72
+ text.blit(screen,[0,y])
73
+ font.underline = false
74
+ end
75
+
76
+ def test_underline_aa(font,screen,y)
77
+ puts "Underline, antialiasing..."
78
+ font.underline = true
79
+ text = font.render("Underline, AA",true,[200,200,200])
80
+ text.blit(screen,[0,y])
81
+ font.underline = false
82
+ end
83
+
84
+ def test_bi_noaa(font,screen,y)
85
+ puts "Bold, Italic, no antialiasing..."
86
+ font.bold = true
87
+ font.italic = true
88
+ text = font.render("B, I, no AA",false,[200,200,200])
89
+ text.blit(screen,[0,y])
90
+ font.bold = false
91
+ font.italic = false
92
+ end
93
+
94
+ def test_bu_noaa(font,screen,y)
95
+ puts "Bold, Underline, no antialiasing..."
96
+ font.bold = true
97
+ font.underline = true
98
+ text = font.render("B, U, no AA",false,[200,200,200])
99
+ text.blit(screen,[0,y])
100
+ font.bold = false
101
+ font.underline = false
102
+ end
103
+
104
+ def test_iu_noaa(font,screen,y)
105
+ puts "Italic, Underline, no antialiasing..."
106
+ font.italic = true
107
+ font.underline = true
108
+ text = font.render("I, U, no AA",false,[200,200,200])
109
+ text.blit(screen,[0,y])
110
+ font.italic = false
111
+ font.underline = false
112
+ end
113
+
114
+ def test_bi_aa(font,screen,y)
115
+ puts "Bold, Italic, antialiasing..."
116
+ font.bold = true
117
+ font.italic = true
118
+ text = font.render("B, I, AA",true,[200,200,200])
119
+ text.blit(screen,[0,y])
120
+ font.bold = false
121
+ font.italic = false
122
+ end
123
+
124
+ def test_bu_aa(font,screen,y)
125
+ puts "Bold, Underline, antialiasing..."
126
+ font.bold = true
127
+ font.underline = true
128
+ text = font.render("B, U, AA",true,[200,200,200])
129
+ text.blit(screen,[0,y])
130
+ font.bold = false
131
+ font.underline = false
132
+ end
133
+
134
+ def test_iu_aa(font,screen,y)
135
+ puts "Italic, Underline, antialiasing..."
136
+ font.italic = true
137
+ font.underline = true
138
+ text = font.render("I, U, AA",true,[200,200,200])
139
+ text.blit(screen,[0,y])
140
+ font.italic = false
141
+ font.underline = false
142
+ end
143
+
144
+ def main
145
+ screen = Screen.set_mode([300,300])
146
+ queue = EventQueue.new()
147
+ queue.ignore = SDL_EVENTS - [QuitEvent, KeyDownEvent]
148
+
149
+
150
+ unless VERSIONS[:sdl_ttf]
151
+ raise "TTF is not usable. Bailing out."
152
+ end
153
+ TTF.setup()
154
+ font = TTF.new("FreeSans.ttf",30)
155
+
156
+ skip = font.line_skip()
157
+
158
+ screen.fill([30,70,30])
159
+ y = -skip
160
+ test_noaa_nobg(font,screen,y+=skip)
161
+ test_noaa_bg(font,screen,y+=skip)
162
+ test_aa_nobg(font,screen,y+=skip)
163
+ test_aa_bg(font,screen,y+=skip)
164
+ screen.update()
165
+
166
+ queue.wait()
167
+
168
+ screen.fill([30,70,30])
169
+ y = -skip
170
+ test_bold_noaa(font,screen,y+=skip)
171
+ test_bold_aa(font,screen,y+=skip)
172
+ test_italic_noaa(font,screen,y+=skip)
173
+ test_italic_aa(font,screen,y+=skip)
174
+ test_underline_noaa(font,screen,y+=skip)
175
+ test_underline_aa(font,screen,y+=skip)
176
+ screen.update()
177
+
178
+ queue.wait()
179
+
180
+ screen.fill([30,70,30])
181
+ y = -skip
182
+ test_bi_noaa(font,screen,y+=skip)
183
+ test_bi_aa(font,screen,y+=skip)
184
+ test_bu_noaa(font,screen,y+=skip)
185
+ test_bu_aa(font,screen,y+=skip)
186
+ test_iu_noaa(font,screen,y+=skip)
187
+ test_iu_aa(font,screen,y+=skip)
188
+ screen.update()
189
+
190
+ queue.wait()
191
+ end
192
+
193
+ main()
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Original script was contributed by ageldama (Yun, Jonghyouk)
4
+
5
+ require 'encoding/character/utf-8'
6
+ require 'rubygame'
7
+
8
+ # Initialize Rubygame
9
+ Rubygame.init
10
+ screen = Rubygame::Screen.set_mode([320,200])
11
+ queue = Rubygame::EventQueue.new
12
+
13
+ # Initialize fonts
14
+
15
+ fontname = 'FreeSans.ttf'
16
+ str = u'abc123하이~'
17
+ if ARGV[0]
18
+ if File.exist?(File.expand_path(ARGV[0]))
19
+ fontname = File.expand_path(ARGV[0])
20
+ str = ARGV[1..-1].join(" ")
21
+ else
22
+ str = ARGV[0..-1].join(" ")
23
+ end
24
+ else
25
+ puts <<EOF
26
+ This script demonstrates UTF8 (8-bit Unicode Transformation Format) text
27
+ rendered with TTF fonts. This allows you to display international symbols
28
+ in your games.
29
+
30
+ If you like, you can give some arguments to this script to try it out:
31
+ 1) A path to a different TTF font to use. (optional)
32
+ *) A custom string to display.
33
+ EOF
34
+ end
35
+
36
+ Rubygame::TTF.setup
37
+ fnt = Rubygame::TTF.new(fontname, 20)
38
+
39
+ loop do
40
+ queue.each do |event|
41
+ case event
42
+ when Rubygame::KeyDownEvent
43
+ Rubygame::TTF.quit
44
+ Rubygame.quit
45
+ exit
46
+ end
47
+ end
48
+
49
+ screen.fill([0, 0, 0])
50
+ surf_str = fnt.render_utf8(str, true, [0xff, 0xff, 0xff])
51
+ surf_str.blit(screen, [10, 10])
52
+ screen.update
53
+ end
data/samples/fist.bmp ADDED
Binary file
@@ -0,0 +1,22 @@
1
+ #/usr/bin/env ruby
2
+
3
+ # A very basic sample application.
4
+
5
+ require "rubygame"
6
+ include Rubygame
7
+
8
+ Rubygame.init
9
+
10
+ screen = Screen.set_mode([320,240])
11
+
12
+ queue = EventQueue.new() {
13
+ |q| q.ignore = [MouseMotionEvent, ActiveEvent]
14
+ }
15
+
16
+ image = Surface.load_image("panda.png")
17
+ puts "Size is: [%s,%s]"%image.size
18
+ image.blit(screen,[0,0])
19
+
20
+ queue.wait() { screen.update() }
21
+
22
+ Rubygame.quit
data/samples/panda.png ADDED
Binary file
data/samples/punch.wav ADDED
Binary file
data/samples/ruby.png ADDED
Binary file
data/samples/song.ogg ADDED
Binary file
Binary file
data/samples/whiff.wav ADDED
Binary file
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.2
3
+ specification_version: 1
4
+ name: rubygame
5
+ version: !ruby/object:Gem::Version
6
+ version: 2.2.0
7
+ date: 2008-01-09 00:00:00 -05:00
8
+ summary: Clean and powerful library for game programming
9
+ require_paths:
10
+ - lib
11
+ - lib/rubygame/
12
+ - ext/rubygame/
13
+ email: jacius@users.sourceforge.net
14
+ homepage: http://rubygame.sourceforge.net/
15
+ rubyforge_project:
16
+ description:
17
+ autorequire: rubygame.rb
18
+ default_executable:
19
+ bindir: bin
20
+ has_rdoc: true
21
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
22
+ requirements:
23
+ - - ">"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.0.0
26
+ version:
27
+ platform: mswin32
28
+ signing_key:
29
+ cert_chain:
30
+ post_install_message:
31
+ authors:
32
+ - John Croisant
33
+ files:
34
+ - lib/rubygame
35
+ - lib/rubygame/clock.rb
36
+ - lib/rubygame/color
37
+ - lib/rubygame/color/models
38
+ - lib/rubygame/color/models/base.rb
39
+ - lib/rubygame/color/models/hsl.rb
40
+ - lib/rubygame/color/models/hsv.rb
41
+ - lib/rubygame/color/models/rgb.rb
42
+ - lib/rubygame/color/palettes
43
+ - lib/rubygame/color/palettes/css.rb
44
+ - lib/rubygame/color/palettes/palette.rb
45
+ - lib/rubygame/color/palettes/x11.rb
46
+ - lib/rubygame/color.rb
47
+ - lib/rubygame/constants.rb
48
+ - lib/rubygame/event.rb
49
+ - lib/rubygame/ftor.rb
50
+ - lib/rubygame/hotspot.rb
51
+ - lib/rubygame/keyconstants.rb
52
+ - lib/rubygame/MANIFEST
53
+ - lib/rubygame/mediabag.rb
54
+ - lib/rubygame/queue.rb
55
+ - lib/rubygame/rect.rb
56
+ - lib/rubygame/sfont.rb
57
+ - lib/rubygame/sprite.rb
58
+ - lib/rubygame.rb
59
+ - ext/rubygame
60
+ - ext/rubygame/MANIFEST
61
+ - ext/rubygame/rubygame_core.so
62
+ - ext/rubygame/rubygame_event.c
63
+ - ext/rubygame/rubygame_event.h
64
+ - ext/rubygame/rubygame_event.obj
65
+ - ext/rubygame/rubygame_gfx.c
66
+ - ext/rubygame/rubygame_gfx.h
67
+ - ext/rubygame/rubygame_gfx.obj
68
+ - ext/rubygame/rubygame_gfx.so
69
+ - ext/rubygame/rubygame_gl.c
70
+ - ext/rubygame/rubygame_gl.h
71
+ - ext/rubygame/rubygame_gl.obj
72
+ - ext/rubygame/rubygame_image.c
73
+ - ext/rubygame/rubygame_image.h
74
+ - ext/rubygame/rubygame_image.obj
75
+ - ext/rubygame/rubygame_image.so
76
+ - ext/rubygame/rubygame_joystick.c
77
+ - ext/rubygame/rubygame_joystick.h
78
+ - ext/rubygame/rubygame_joystick.obj
79
+ - ext/rubygame/rubygame_main.c
80
+ - ext/rubygame/rubygame_main.h
81
+ - ext/rubygame/rubygame_main.obj
82
+ - ext/rubygame/rubygame_mixer.c
83
+ - ext/rubygame/rubygame_mixer.h
84
+ - ext/rubygame/rubygame_mixer.obj
85
+ - ext/rubygame/rubygame_mixer.so
86
+ - ext/rubygame/rubygame_screen.c
87
+ - ext/rubygame/rubygame_screen.h
88
+ - ext/rubygame/rubygame_screen.obj
89
+ - ext/rubygame/rubygame_shared.c
90
+ - ext/rubygame/rubygame_shared.h
91
+ - ext/rubygame/rubygame_shared.obj
92
+ - ext/rubygame/rubygame_surface.c
93
+ - ext/rubygame/rubygame_surface.h
94
+ - ext/rubygame/rubygame_surface.obj
95
+ - ext/rubygame/rubygame_time.c
96
+ - ext/rubygame/rubygame_time.h
97
+ - ext/rubygame/rubygame_time.obj
98
+ - ext/rubygame/rubygame_ttf.c
99
+ - ext/rubygame/rubygame_ttf.h
100
+ - ext/rubygame/rubygame_ttf.obj
101
+ - ext/rubygame/rubygame_ttf.so
102
+ - samples/chimp.bmp
103
+ - samples/chimp.rb
104
+ - samples/demo_gl.rb
105
+ - samples/demo_gl_tex.rb
106
+ - samples/demo_music.rb
107
+ - samples/demo_rubygame.rb
108
+ - samples/demo_sfont.rb
109
+ - samples/demo_ttf.rb
110
+ - samples/demo_utf8.rb
111
+ - samples/fist.bmp
112
+ - samples/FreeSans.ttf
113
+ - samples/GPL.txt
114
+ - samples/load_and_blit.rb
115
+ - samples/panda.png
116
+ - samples/punch.wav
117
+ - samples/README
118
+ - samples/ruby.png
119
+ - samples/song.ogg
120
+ - samples/term16.png
121
+ - samples/whiff.wav
122
+ - doc/extended_readme.rdoc
123
+ - doc/getting_started.rdoc
124
+ - doc/macosx_install.rdoc
125
+ - doc/windows_install.rdoc
126
+ - README
127
+ - LICENSE
128
+ - CREDITS
129
+ - ROADMAP
130
+ - NEWS
131
+ test_files: []
132
+
133
+ rdoc_options: []
134
+
135
+ extra_rdoc_files:
136
+ - doc/extended_readme.rdoc
137
+ - doc/getting_started.rdoc
138
+ - doc/macosx_install.rdoc
139
+ - doc/windows_install.rdoc
140
+ - README
141
+ - LICENSE
142
+ - CREDITS
143
+ - ROADMAP
144
+ - NEWS
145
+ executables: []
146
+
147
+ extensions:
148
+ - Rakefile
149
+ requirements: []
150
+
151
+ dependencies: []
152
+