rubygame 2.2.0-i586-linux

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 +123 -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.o +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.o +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.o +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.o +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.o +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.o +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.o +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.o +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.o +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.o +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.o +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.o +0 -0
  52. data/ext/rubygame/rubygame_ttf.so +0 -0
  53. data/lib/rubygame/MANIFEST +12 -0
  54. data/lib/rubygame/clock.rb +128 -0
  55. data/lib/rubygame/color/models/base.rb +106 -0
  56. data/lib/rubygame/color/models/hsl.rb +153 -0
  57. data/lib/rubygame/color/models/hsv.rb +149 -0
  58. data/lib/rubygame/color/models/rgb.rb +78 -0
  59. data/lib/rubygame/color/palettes/css.rb +49 -0
  60. data/lib/rubygame/color/palettes/palette.rb +100 -0
  61. data/lib/rubygame/color/palettes/x11.rb +177 -0
  62. data/lib/rubygame/color.rb +79 -0
  63. data/lib/rubygame/constants.rb +238 -0
  64. data/lib/rubygame/event.rb +313 -0
  65. data/lib/rubygame/ftor.rb +370 -0
  66. data/lib/rubygame/hotspot.rb +265 -0
  67. data/lib/rubygame/keyconstants.rb +237 -0
  68. data/lib/rubygame/mediabag.rb +94 -0
  69. data/lib/rubygame/queue.rb +288 -0
  70. data/lib/rubygame/rect.rb +612 -0
  71. data/lib/rubygame/sfont.rb +223 -0
  72. data/lib/rubygame/sprite.rb +511 -0
  73. data/lib/rubygame.rb +41 -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.4
3
+ specification_version: 1
4
+ name: rubygame
5
+ version: !ruby/object:Gem::Version
6
+ version: 2.2.0
7
+ date: 2007-12-19 00:00:00 -06: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: i586-linux
28
+ signing_key:
29
+ cert_chain:
30
+ post_install_message:
31
+ authors:
32
+ - John Croisant
33
+ files:
34
+ - lib/rubygame.rb
35
+ - lib/rubygame
36
+ - lib/rubygame/MANIFEST
37
+ - lib/rubygame/ftor.rb
38
+ - lib/rubygame/clock.rb
39
+ - lib/rubygame/constants.rb
40
+ - lib/rubygame/color
41
+ - lib/rubygame/color/models
42
+ - lib/rubygame/color/models/rgb.rb
43
+ - lib/rubygame/color/models/hsl.rb
44
+ - lib/rubygame/color/models/hsv.rb
45
+ - lib/rubygame/color/models/base.rb
46
+ - lib/rubygame/color/palettes
47
+ - lib/rubygame/color/palettes/palette.rb
48
+ - lib/rubygame/color/palettes/css.rb
49
+ - lib/rubygame/color/palettes/x11.rb
50
+ - lib/rubygame/event.rb
51
+ - lib/rubygame/rect.rb
52
+ - lib/rubygame/mediabag.rb
53
+ - lib/rubygame/color.rb
54
+ - lib/rubygame/sprite.rb
55
+ - lib/rubygame/keyconstants.rb
56
+ - lib/rubygame/hotspot.rb
57
+ - lib/rubygame/sfont.rb
58
+ - lib/rubygame/queue.rb
59
+ - ext/rubygame
60
+ - ext/rubygame/rubygame_event.h
61
+ - ext/rubygame/rubygame_mixer.c
62
+ - ext/rubygame/rubygame_core.so
63
+ - ext/rubygame/rubygame_ttf.h
64
+ - ext/rubygame/rubygame_main.c
65
+ - ext/rubygame/rubygame_joystick.h
66
+ - ext/rubygame/MANIFEST
67
+ - ext/rubygame/rubygame_gfx.h
68
+ - ext/rubygame/rubygame_shared.c
69
+ - ext/rubygame/rubygame_surface.o
70
+ - ext/rubygame/rubygame_gl.h
71
+ - ext/rubygame/rubygame_screen.c
72
+ - ext/rubygame/rubygame_main.o
73
+ - ext/rubygame/rubygame_shared.h
74
+ - ext/rubygame/rubygame_time.c
75
+ - ext/rubygame/rubygame_image.h
76
+ - ext/rubygame/rubygame_surface.h
77
+ - ext/rubygame/rubygame_event.o
78
+ - ext/rubygame/rubygame_gl.o
79
+ - ext/rubygame/rubygame_ttf.so
80
+ - ext/rubygame/rubygame_screen.h
81
+ - ext/rubygame/rubygame_time.h
82
+ - ext/rubygame/rubygame_joystick.c
83
+ - ext/rubygame/rubygame_screen.o
84
+ - ext/rubygame/rubygame_surface.c
85
+ - ext/rubygame/rubygame_ttf.o
86
+ - ext/rubygame/rubygame_mixer.o
87
+ - ext/rubygame/rubygame_main.h
88
+ - ext/rubygame/rubygame_gfx.c
89
+ - ext/rubygame/rubygame_gfx.so
90
+ - ext/rubygame/rubygame_gfx.o
91
+ - ext/rubygame/rubygame_joystick.o
92
+ - ext/rubygame/rubygame_image.so
93
+ - ext/rubygame/rubygame_event.c
94
+ - ext/rubygame/rubygame_shared.o
95
+ - ext/rubygame/rubygame_ttf.c
96
+ - ext/rubygame/rubygame_gl.c
97
+ - ext/rubygame/rubygame_time.o
98
+ - ext/rubygame/rubygame_mixer.h
99
+ - ext/rubygame/rubygame_image.o
100
+ - ext/rubygame/rubygame_mixer.so
101
+ - ext/rubygame/rubygame_image.c
102
+ - samples/demo_utf8.rb
103
+ - samples/README
104
+ - samples/song.ogg
105
+ - samples/GPL.txt
106
+ - samples/demo_music.rb
107
+ - samples/whiff.wav
108
+ - samples/demo_rubygame.rb
109
+ - samples/demo_gl.rb
110
+ - samples/chimp.bmp
111
+ - samples/term16.png
112
+ - samples/chimp.rb
113
+ - samples/demo_ttf.rb
114
+ - samples/panda.png
115
+ - samples/punch.wav
116
+ - samples/FreeSans.ttf
117
+ - samples/demo_sfont.rb
118
+ - samples/demo_gl_tex.rb
119
+ - samples/ruby.png
120
+ - samples/load_and_blit.rb
121
+ - samples/fist.bmp
122
+ - doc/windows_install.rdoc
123
+ - doc/macosx_install.rdoc
124
+ - doc/getting_started.rdoc
125
+ - doc/extended_readme.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/windows_install.rdoc
137
+ - doc/macosx_install.rdoc
138
+ - doc/getting_started.rdoc
139
+ - doc/extended_readme.rdoc
140
+ - README
141
+ - LICENSE
142
+ - CREDITS
143
+ - ROADMAP
144
+ - NEWS
145
+ executables: []
146
+
147
+ extensions:
148
+ - Rakefile
149
+ requirements: []
150
+
151
+ dependencies: []
152
+