rubygame 2.5.3 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CREDITS +6 -4
- data/NEWS +79 -0
- data/README +55 -72
- data/ROADMAP +20 -13
- data/doc/custom_sdl_load_paths.rdoc +79 -0
- data/doc/getting_started.rdoc +65 -36
- data/doc/keyboard_symbols.rdoc +243 -0
- data/doc/macosx_install.rdoc +49 -35
- data/doc/windows_install.rdoc +36 -108
- data/lib/rubygame.rb +62 -24
- data/lib/rubygame/audio.rb +147 -0
- data/lib/rubygame/clock.rb +164 -1
- data/lib/rubygame/color.rb +40 -7
- data/lib/rubygame/color/models/hsl.rb +1 -1
- data/lib/rubygame/color/models/hsv.rb +1 -1
- data/lib/rubygame/color/models/rgb.rb +1 -1
- data/lib/rubygame/color/palettes/css.rb +1 -3
- data/lib/rubygame/color/palettes/x11.rb +1 -2
- data/lib/rubygame/constants.rb +297 -0
- data/lib/rubygame/deprecated_mixer.rb +555 -0
- data/lib/rubygame/event.rb +122 -6
- data/lib/rubygame/event_handler.rb +3 -1
- data/lib/rubygame/event_hook.rb +6 -2
- data/lib/rubygame/event_triggers.rb +1 -1
- data/lib/rubygame/events.rb +416 -1
- data/lib/rubygame/ftor.rb +1 -7
- data/lib/rubygame/gfx.rb +583 -0
- data/lib/rubygame/gl.rb +107 -0
- data/lib/rubygame/image.rb +140 -0
- data/lib/rubygame/joystick.rb +184 -0
- data/lib/rubygame/main.rb +82 -0
- data/lib/rubygame/mediabag.rb +1 -1
- data/lib/rubygame/mixer.rb +30 -0
- data/lib/rubygame/music.rb +493 -0
- data/lib/rubygame/queue.rb +3 -1
- data/lib/rubygame/rect.rb +9 -9
- data/lib/rubygame/screen.rb +357 -0
- data/lib/rubygame/shared.rb +40 -4
- data/lib/rubygame/sound.rb +428 -0
- data/lib/rubygame/surface.rb +626 -0
- data/lib/rubygame/ttf.rb +311 -0
- data/samples/FreeSans.ttf +0 -0
- data/samples/README +6 -5
- data/samples/demo_draw.rb +1 -1
- data/samples/demo_gl.rb +3 -1
- data/samples/demo_gl_tex.rb +4 -2
- data/samples/demo_rubygame.rb +114 -105
- data/samples/demo_sfont.rb +1 -1
- data/samples/demo_ttf.rb +3 -1
- data/samples/demo_utf8.rb +1 -1
- data/samples/image_viewer.rb +118 -0
- data/samples/load_and_blit.rb +1 -1
- data/samples/rubygame.png +0 -0
- metadata +34 -40
- data/Rakefile +0 -537
- data/doc/extended_readme.rdoc +0 -49
- data/ext/body/rubygame_body.so +0 -0
- data/ext/rubygame/rubygame_clock.c +0 -301
- data/ext/rubygame/rubygame_clock.h +0 -32
- data/ext/rubygame/rubygame_event.c +0 -760
- data/ext/rubygame/rubygame_event.h +0 -48
- data/ext/rubygame/rubygame_event2.c +0 -661
- data/ext/rubygame/rubygame_event2.h +0 -29
- data/ext/rubygame/rubygame_gfx.c +0 -942
- data/ext/rubygame/rubygame_gfx.h +0 -101
- data/ext/rubygame/rubygame_gl.c +0 -154
- data/ext/rubygame/rubygame_gl.h +0 -32
- data/ext/rubygame/rubygame_image.c +0 -252
- data/ext/rubygame/rubygame_image.h +0 -41
- data/ext/rubygame/rubygame_joystick.c +0 -336
- data/ext/rubygame/rubygame_joystick.h +0 -41
- data/ext/rubygame/rubygame_main.c +0 -158
- data/ext/rubygame/rubygame_main.h +0 -36
- data/ext/rubygame/rubygame_mixer.c +0 -1024
- data/ext/rubygame/rubygame_mixer.h +0 -36
- data/ext/rubygame/rubygame_music.c +0 -1017
- data/ext/rubygame/rubygame_music.h +0 -29
- data/ext/rubygame/rubygame_screen.c +0 -572
- data/ext/rubygame/rubygame_screen.h +0 -45
- data/ext/rubygame/rubygame_shared.c +0 -269
- data/ext/rubygame/rubygame_shared.h +0 -69
- data/ext/rubygame/rubygame_sound.c +0 -863
- data/ext/rubygame/rubygame_sound.h +0 -29
- data/ext/rubygame/rubygame_surface.c +0 -1153
- data/ext/rubygame/rubygame_surface.h +0 -62
- data/ext/rubygame/rubygame_ttf.c +0 -599
- data/ext/rubygame/rubygame_ttf.h +0 -69
- data/samples/keys.rb +0 -52
data/ext/rubygame/rubygame_ttf.h
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Rubygame -- Ruby code and bindings to SDL to facilitate game creation
|
3
|
-
* Copyright (C) 2004-2007 John Croisant
|
4
|
-
*
|
5
|
-
* This library is free software; you can redistribute it and/or
|
6
|
-
* modify it under the terms of the GNU Lesser General Public
|
7
|
-
* License as published by the Free Software Foundation; either
|
8
|
-
* version 2.1 of the License, or (at your option) any later version.
|
9
|
-
*
|
10
|
-
* This library is distributed in the hope that it will be useful,
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
* Lesser General Public License for more details.
|
14
|
-
*
|
15
|
-
* You should have received a copy of the GNU Lesser General Public
|
16
|
-
* License along with this library; if not, write to the Free Software
|
17
|
-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18
|
-
*
|
19
|
-
*/
|
20
|
-
|
21
|
-
#ifndef _RUBYGAME_TTF_H
|
22
|
-
#define _RUBYGAME_TTF_H
|
23
|
-
|
24
|
-
#include "SDL_ttf.h"
|
25
|
-
|
26
|
-
#ifndef SDL_TTF_MAJOR_VERSION
|
27
|
-
#define SDL_TTF_MAJOR_VERSION 0
|
28
|
-
#endif
|
29
|
-
|
30
|
-
#ifndef SDL_TTF_MINOR_VERSION
|
31
|
-
#define SDL_TTF_MINOR_VERSION 0
|
32
|
-
#endif
|
33
|
-
|
34
|
-
#ifndef SDL_TTF_PATCHLEVEL
|
35
|
-
#define SDL_TTF_PATCHLEVEL 0
|
36
|
-
#endif
|
37
|
-
|
38
|
-
extern void Init_rubygame_ttf();
|
39
|
-
|
40
|
-
extern VALUE cTTF;
|
41
|
-
|
42
|
-
extern VALUE rbgm_ttf_setup(VALUE);
|
43
|
-
extern VALUE rbgm_ttf_quit(VALUE);
|
44
|
-
extern VALUE rbgm_ttf_new(VALUE, VALUE, VALUE);
|
45
|
-
extern VALUE rbgm_ttf_initialize(int, VALUE*, VALUE);
|
46
|
-
|
47
|
-
extern VALUE rbgm_ttf_getbold(VALUE);
|
48
|
-
extern VALUE rbgm_ttf_setbold(VALUE, VALUE);
|
49
|
-
|
50
|
-
extern VALUE rbgm_ttf_getitalic(VALUE);
|
51
|
-
extern VALUE rbgm_ttf_setitalic(VALUE, VALUE);
|
52
|
-
|
53
|
-
extern VALUE rbgm_ttf_getunderline(VALUE);
|
54
|
-
extern VALUE rbgm_ttf_setunderline(VALUE, VALUE);
|
55
|
-
|
56
|
-
extern VALUE rbgm_ttf_height(VALUE);
|
57
|
-
extern VALUE rbgm_ttf_ascent(VALUE);
|
58
|
-
extern VALUE rbgm_ttf_descent(VALUE);
|
59
|
-
extern VALUE rbgm_ttf_lineskip(VALUE);
|
60
|
-
|
61
|
-
extern VALUE rbgm_ttf_sizetext(VALUE, VALUE);
|
62
|
-
extern VALUE rbgm_ttf_size_utf8(VALUE, VALUE);
|
63
|
-
extern VALUE rbgm_ttf_size_unicode(VALUE, VALUE);
|
64
|
-
|
65
|
-
extern VALUE rbgm_ttf_render(int, VALUE*, VALUE);
|
66
|
-
extern VALUE rbgm_ttf_render_utf8(int , VALUE*, VALUE);
|
67
|
-
extern VALUE rbgm_ttf_render_unicode(int , VALUE*, VALUE);
|
68
|
-
|
69
|
-
#endif
|
data/samples/keys.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# Quick and dirty test app to print out info about keys that are pressed.
|
4
|
-
|
5
|
-
|
6
|
-
require "rubygame"
|
7
|
-
include Rubygame
|
8
|
-
|
9
|
-
|
10
|
-
def setup
|
11
|
-
Rubygame.init
|
12
|
-
|
13
|
-
$queue = EventQueue.new
|
14
|
-
$queue.enable_new_style_events
|
15
|
-
|
16
|
-
$screen = Screen.open([640,480])
|
17
|
-
|
18
|
-
# We'll store the last $buffer_maxlen lines of the text buffer here.
|
19
|
-
$buffer = []
|
20
|
-
$buffer_maxlen = 20
|
21
|
-
|
22
|
-
# Load the font
|
23
|
-
TTF.setup
|
24
|
-
ttf_file = File.join( File.dirname(__FILE__), "FreeSans.ttf" )
|
25
|
-
|
26
|
-
$font_size = 24
|
27
|
-
$font = TTF.new( ttf_file, $font_size )
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
def String.pad_to( length, padding=" " )
|
32
|
-
extra = length < self.length ? length - self.length : 0
|
33
|
-
return self + padding * extra
|
34
|
-
end
|
35
|
-
|
36
|
-
def format_event( event )
|
37
|
-
klass = (event.class.name+":").pad_to(7)
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
def add_to_buffer( text )
|
43
|
-
surface = $font.render_unicode(text, true, :white)
|
44
|
-
$buffer.push( text )
|
45
|
-
$buffer.shift if $buffer.length > $buffer_maxlen
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
def redraw_buffer
|
50
|
-
$screen.fill( :black )
|
51
|
-
|
52
|
-
end
|