rubysdl 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +505 -0
- data/MANIFEST +81 -0
- data/NEWS.en +144 -0
- data/NEWS.ja +151 -0
- data/README.en +117 -0
- data/README.ja +166 -0
- data/SDL_kanji.c +403 -0
- data/SDL_kanji.h +48 -0
- data/depend +18 -0
- data/doc/Makefile +18 -0
- data/doc/cdrom.rsd +431 -0
- data/doc/collision.rsd +162 -0
- data/doc/event.rsd +1487 -0
- data/doc/font.rsd +839 -0
- data/doc/general.rsd +49 -0
- data/doc/init.rsd +175 -0
- data/doc/joystick.rsd +387 -0
- data/doc/mixer.rsd +837 -0
- data/doc/mpeg.rsd +595 -0
- data/doc/rsd.rb +125 -0
- data/doc/sdlskk.rsd +496 -0
- data/doc/time.rsd +45 -0
- data/doc/video.rsd +2499 -0
- data/doc/wm.rsd +113 -0
- data/extconf.rb +92 -0
- data/lib/rubysdl_aliases.rb +431 -0
- data/lib/sdl.rb +271 -0
- data/rubysdl.h +109 -0
- data/rubysdl_cdrom.c +176 -0
- data/rubysdl_const_list.txt +280 -0
- data/rubysdl_doc.en.rd +2180 -0
- data/rubysdl_doc_old.rd +2402 -0
- data/rubysdl_event.c +346 -0
- data/rubysdl_event2.c +417 -0
- data/rubysdl_event_key.c +356 -0
- data/rubysdl_image.c +53 -0
- data/rubysdl_joystick.c +156 -0
- data/rubysdl_kanji.c +135 -0
- data/rubysdl_main.c +202 -0
- data/rubysdl_mixer.c +422 -0
- data/rubysdl_mouse.c +96 -0
- data/rubysdl_opengl.c +63 -0
- data/rubysdl_pixel.c +133 -0
- data/rubysdl_ref.html +5550 -0
- data/rubysdl_ref.rd +6163 -0
- data/rubysdl_rwops.c +90 -0
- data/rubysdl_sdlskk.c +312 -0
- data/rubysdl_sge_video.c +622 -0
- data/rubysdl_smpeg.c +341 -0
- data/rubysdl_time.c +36 -0
- data/rubysdl_ttf.c +324 -0
- data/rubysdl_video.c +749 -0
- data/rubysdl_wm.c +71 -0
- data/sample/aadraw.rb +24 -0
- data/sample/alpha.rb +27 -0
- data/sample/alphadraw.rb +25 -0
- data/sample/bfont.rb +24 -0
- data/sample/cdrom.rb +17 -0
- data/sample/collision.rb +97 -0
- data/sample/cursor.bmp +0 -0
- data/sample/cursor.rb +22 -0
- data/sample/ellipses.rb +35 -0
- data/sample/event2.rb +32 -0
- data/sample/font.bmp +0 -0
- data/sample/font.rb +25 -0
- data/sample/fpstimer.rb +175 -0
- data/sample/icon.bmp +0 -0
- data/sample/joy2.rb +81 -0
- data/sample/kanji.rb +36 -0
- data/sample/movesp.rb +93 -0
- data/sample/playmod.rb +14 -0
- data/sample/plaympeg.rb +48 -0
- data/sample/playwave.rb +16 -0
- data/sample/randrect.rb +40 -0
- data/sample/sample.ttf +0 -0
- data/sample/sdlskk.rb +70 -0
- data/sample/sgetest.rb +31 -0
- data/sample/stetris.rb +275 -0
- data/sample/testgl.rb +166 -0
- data/sample/testsprite.rb +68 -0
- data/sample/transformblit.rb +41 -0
- metadata +121 -0
data/doc/general.rsd
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
= �ܼ�
|
2
|
+
* ((<"Ruby/SDL���">))
|
3
|
+
* ((<�����>))
|
4
|
+
* ((<Video>))
|
5
|
+
* ((<Window Management>))
|
6
|
+
* ((<Event>))
|
7
|
+
* ((<Joystick>))
|
8
|
+
* ((<CD-ROM>))
|
9
|
+
* ((<Audio>))
|
10
|
+
* ((<Time>))
|
11
|
+
* ((<Font>))
|
12
|
+
* ((<����Ƚ��>))
|
13
|
+
* ((<SDLSKK>))
|
14
|
+
* ((<MPEG playback>))
|
15
|
+
|
16
|
+
= Ruby/SDL���
|
17
|
+
Ruby/SDL �� ((<SDL|URL:http://www.libsdl.org/>)) ��
|
18
|
+
((<Ruby|URL:http://www.ruby-lang.org/>)) �������Ѥ��뤿���
|
19
|
+
��ĥ�饤�֥��Ǥ���
|
20
|
+
Ruby �ǥ�����ʤɤ�Ȥ�����ʤɤ����ѤǤ��ޤ���
|
21
|
+
|
22
|
+
Ruby/SDL�ϡ��ʲ��ε�ǽ����äƤ��ޤ���
|
23
|
+
* ((<2D��®����|Video>))
|
24
|
+
* ((<�����ܡ��ɤ�ޥ���|Event>))��((<���祤���ƥ��å�|Joystick>))����
|
25
|
+
�����Ϥμ�갷��
|
26
|
+
* ((<SDL_mixer|URL:http://www.libsdl.org/projects/SDL_mixer/index.html>))
|
27
|
+
�ˤ��((<��������|Audio>))
|
28
|
+
* ((<CD-ROM���|CD-ROM>))
|
29
|
+
* ((<SDL_ttf|URL:http://www.libsdl.org/projects/SDL_ttf/index.html>))��
|
30
|
+
((<SDL_kanji|URL:http://shinh.skr.jp/sdlkanji/>))��
|
31
|
+
((<SGE|URL:http://www.etek.chalmers.se/~e8cal1/sge/index.html>))
|
32
|
+
�ˤ��((<ʸ���������|Font>))
|
33
|
+
* ((<OpenGL Interface|URL:http://www2.giganet.net/~yoshi/>))�ˤ��
|
34
|
+
3D����
|
35
|
+
* ((<���֤η�¬����Ӱ�����|Time>))
|
36
|
+
* ((<SDLSKK|URL:http://www.kmc.gr.jp/~ohai/sdlskk.html>))�ˤ�롢
|
37
|
+
((<��ñ�̤����ܸ�����|SDLSKK>))
|
38
|
+
* ((<SMPGE|URL:http://www.icculus.org/smpeg/>))�ˤ��
|
39
|
+
((<mpeg���|MPEG playback>))
|
40
|
+
* ����¾�ˤ⡢((<Window�δ���|Window Management>))��
|
41
|
+
((<����Ƚ��>))�ʤ�
|
42
|
+
|
43
|
+
|
44
|
+
== SDL::Error
|
45
|
+
SDL��ͭ�Υ��顼��ɽ�魯�㳰���饹�Ǥ���StandardError��Ѿ����Ƥ��ޤ���
|
46
|
+
|
47
|
+
== SDL::VERSION
|
48
|
+
SDL�ΥС�������ɽ�魯ʸ����Ǥ���"1.0.0"�Ȥ������ˤʤäƤ��ޤ���
|
49
|
+
|
data/doc/init.rsd
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
= �����
|
2
|
+
TOC
|
3
|
+
|
4
|
+
Ruby/SDL��Ȥ����ˤ�ɬ��@[init]�ǽ��������ɬ�פ�����ޤ���@[init]�ϡ�
|
5
|
+
�桼���λ��ꤷ�����٤ƤΥ��֥����ƥ�(�ӥǥ��������ǥ��������祤���ƥ��å���
|
6
|
+
�����ޡ���CD-ROM�Τ����줫���뤤������)���������뤳�Ȥ��Ǥ��ޤ���
|
7
|
+
|
8
|
+
== Methods
|
9
|
+
%%%
|
10
|
+
NAME init
|
11
|
+
TYPE .
|
12
|
+
PURPOSE SDL���������ޤ���
|
13
|
+
|
14
|
+
PROTO
|
15
|
+
init(flags)
|
16
|
+
|
17
|
+
DESC
|
18
|
+
SDL���������ޤ���
|
19
|
+
���٤Ƥ�Ruby/SDL�Υ�åɤ�ƤӽФ����ˤ��δؿ����ƤФ�ʤ���Ф����ޤ���
|
20
|
+
$[flags]�ˤ�SDL�Τɤ���ʬ���������뤫����ꤷ�ޤ���
|
21
|
+
:SDL::INIT_AUDIO
|
22
|
+
�����ǥ������֥����ƥ�(�������ϵ�ǽ)������
|
23
|
+
:SDL::INIT_VIDEO
|
24
|
+
�ӥǥ����֥����ƥ�(�������ϵ�ǽ�ȥ����ܡ��ɡ��ޥ������ϵ�ǽ)������
|
25
|
+
:SDL::INIT_CDROM
|
26
|
+
CDROM���֥����ƥ�(CD������ǽ)������
|
27
|
+
:SDL::INIT_JOYSTICK
|
28
|
+
���祤���ƥ��å����֥����ƥ�(���祤���ƥ��å����ϵ�ǽ)������
|
29
|
+
:SDL::INIT_EVERYTHING
|
30
|
+
��˵���ǽ�����ƽ�������ޤ���
|
31
|
+
|
32
|
+
EXCEPTION
|
33
|
+
���Ԥ�����㳰@[Error]��ȯ�����ޤ���
|
34
|
+
|
35
|
+
%%
|
36
|
+
NAME quit
|
37
|
+
TYPE .
|
38
|
+
PURPOSE SDL��åȥ����ޤ���
|
39
|
+
|
40
|
+
PROTO
|
41
|
+
quit
|
42
|
+
|
43
|
+
DESC
|
44
|
+
���Ƥ�SDL���֥����ƥ��åȥ���������餬���ݤ���������٤Ʋ�
|
45
|
+
�����ޤ����̾�ϼ�ư�ǸƤФ�뤿��桼��������Ū�˸ƤӤ���ɬ�פϤ���ޤ���
|
46
|
+
|
47
|
+
SDL�����Ruby/SDL�λ��ͤ��������ɬ�פʾ��ΤȤäƤ���������
|
48
|
+
|
49
|
+
%%
|
50
|
+
NAME inited_system
|
51
|
+
TYPE .
|
52
|
+
PURPOSE ���֥����ƥब���������Ƥ��뤫�ɤ���������å����ޤ���
|
53
|
+
RVAL UINT
|
54
|
+
|
55
|
+
PROTO
|
56
|
+
inited_system(flags)
|
57
|
+
initedSystem(flags)
|
58
|
+
|
59
|
+
DESC
|
60
|
+
����ϡ��ɤ�SDL���֥����ƥब@[���������Ƥ��뤫|init]����𤷤ޤ���
|
61
|
+
$[flags]�ˤϡ�Ĵ�٤������֥����ƥ�������¤���ꤷ�ޤ�
|
62
|
+
(����Ǥ��륵�֥����ƥ�Υե饰�ˤĤ��Ƥ�@[init]�ι�Ȥ��Ƥ�������)��
|
63
|
+
|
64
|
+
RET
|
65
|
+
���������Ƥ��륵�֥����ƥ�������¤��֤��ޤ���
|
66
|
+
|
67
|
+
EXAMPLE
|
68
|
+
# SDL.inited_system�λȤ�����
|
69
|
+
|
70
|
+
# ���ƤΥ��֥����ƥ�ν�������֤����ޤ�
|
71
|
+
subsystem_init = SDL.inited_system(SDL::INIT_EVERYTHING)
|
72
|
+
|
73
|
+
if subsystem_init & SDL::INIT_VIDEO
|
74
|
+
puts "�ӥǥ��Ͻ��������Ƥ��ޤ���"
|
75
|
+
else
|
76
|
+
puts "�ӥǥ��Ͻ��������Ƥ��ޤ���"
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
# 1�ĤΥ��֥����ƥ����������å����ޤ�
|
82
|
+
|
83
|
+
if SDL.inited_system(SDL::INIT_VIDEO) != 0
|
84
|
+
puts "�ӥǥ��Ͻ��������Ƥ��ޤ���"
|
85
|
+
else
|
86
|
+
puts "�ӥǥ��Ͻ��������Ƥ��ޤ���"
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
# 2�ĤΥ��֥����ƥ������å����ޤ�
|
92
|
+
|
93
|
+
subsystem_mask = SDL::INIT_VIDEO|SDL::INIT_AUDIO;
|
94
|
+
|
95
|
+
if SDL.inited_system(subsystem_mask) == subsystem_mask
|
96
|
+
puts "�ӥǥ��ȥ����ǥ����Ϥɤ������������Ƥ��ޤ���"
|
97
|
+
else
|
98
|
+
puts "�ӥǥ��ȥ����ǥ����Τɤ��餫���ޤ���ξ�������������Ƥ��ޤ���"
|
99
|
+
end
|
100
|
+
|
101
|
+
SEEALSO
|
102
|
+
init
|
103
|
+
|
104
|
+
%%
|
105
|
+
NAME getenv
|
106
|
+
TYPE .
|
107
|
+
PURPOSE �Ķ��ѿ������ޤ���
|
108
|
+
RVAL String
|
109
|
+
|
110
|
+
PROTO
|
111
|
+
getenv(var)
|
112
|
+
|
113
|
+
DESC
|
114
|
+
$[var]�ǻ��ꤷ���Ķ��ѿ������ޤ���
|
115
|
+
|
116
|
+
RET
|
117
|
+
�Ķ��ѿ����ͤ�ʸ������֤��ޤ���
|
118
|
+
|
119
|
+
%%
|
120
|
+
NAME putenv
|
121
|
+
TYPE .
|
122
|
+
PURPOSE �Ķ��ѿ����ѹ����ޤ���
|
123
|
+
|
124
|
+
PROTO
|
125
|
+
putenv(string)
|
126
|
+
|
127
|
+
DESC
|
128
|
+
�Ķ��ѿ����ɲäޤ����ͤ��ѹ���Ԥ��ޤ���$[string] �� "name=value"
|
129
|
+
�Ȥ�����������ޤ���
|
130
|
+
|
131
|
+
Windows���SDL_WINDOWID��SDL_VIDEODRIVER�Ȥ��ä��Ķ��ѿ���Ȥä�
|
132
|
+
SDL�μ¹Ԥ˱ƶ���Ϳ�������Ȥ������Ѥ��ޤ���
|
133
|
+
SDL�λ��ͤˤ��Windows�Ǥ� ENV ��ľ���ѹ����Ƥ⤳���ε�ǽ���Ȥ�
|
134
|
+
�ʤ����ᤳ�Τ褦�ʴؿ���¸�ߤ��ޡ�Unix��Ǥ� ENV ��Ȥ��Τ�Ʊ��
|
135
|
+
���̤�����ޤ���
|
136
|
+
|
137
|
+
EXCEPTION
|
138
|
+
���Ի��ˤ��㳰@[Error]��ȯ�������ޤ���
|
139
|
+
|
140
|
+
EXAMPLE
|
141
|
+
# http://moriq.tdiary.net/20051006.html ���
|
142
|
+
# Ruby/SDL �� Apollo��ʻ��
|
143
|
+
require 'phi'
|
144
|
+
require 'sdl'
|
145
|
+
|
146
|
+
# �ե����������
|
147
|
+
form = Phi::Form.new
|
148
|
+
$terminated = false
|
149
|
+
form.on_close{ $terminated = true }
|
150
|
+
form.caption = "Ruby/SDL on Phi::Form"
|
151
|
+
# �ѥͥ��ե�����ξ�˺��
|
152
|
+
panel = Phi::Panel.new(form)
|
153
|
+
panel.align = Phi::AL_LEFT
|
154
|
+
|
155
|
+
# WINDOWID hack��Ȥ����ѥͥ��SDL�Υ�����ɥ���Τ���
|
156
|
+
SDL.putenv("SDL_VIDEODRIVER=windib")
|
157
|
+
SDL.putenv("SDL_WINDOWID=#{panel.handle}")
|
158
|
+
form.show
|
159
|
+
|
160
|
+
# SDL���Τν�����ʤ�
|
161
|
+
SDL.init(SDL::INIT_VIDEO)
|
162
|
+
screen = SDL.setVideoMode(640, 480, 16, SDL::SWSURFACE)
|
163
|
+
|
164
|
+
# �ᥤ��롼�ס��Ȥꤢ�������⤷�ʤ�
|
165
|
+
unless $terminated
|
166
|
+
while event = SDL::Event2.poll
|
167
|
+
case event
|
168
|
+
when SDL::Event2::KeyDown, SDL::Event2::Quit
|
169
|
+
exit
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
sleep 0.05
|
174
|
+
end
|
175
|
+
|
data/doc/joystick.rsd
ADDED
@@ -0,0 +1,387 @@
|
|
1
|
+
= Joystick
|
2
|
+
* ((<Joystick��ǽ����>))
|
3
|
+
* ((<SDL::Joystick>))
|
4
|
+
* ���祤���ƥ��å���Ϣ��å�
|
5
|
+
TOC
|
6
|
+
|
7
|
+
== Joystick��ǽ����
|
8
|
+
���祤���ƥ��å����ޤ�����˶ᤤ¾�ΥǥХ����ϡ�
|
9
|
+
������ץ쥤�ˤ��������˶���������äƤ��ꡢ
|
10
|
+
SDL �Ϥ������ϰϤ˥��ݡ��Ȥ��Ƥ��ޤ���
|
11
|
+
�����ܥ���POV �ϥåȥ����å��������ƥȥ�å��ܡ����
|
12
|
+
���ƥ��ݡ��Ȥ���Ƥޤ���
|
13
|
+
|
14
|
+
���祤���ƥ��å��Υ��ݡ��Ȥ�
|
15
|
+
@[init] �� SDL::INIT_JOYSTICK �ե饰���Ϥ����Ȥǽ��������ޤ���
|
16
|
+
���ä����������줿���祤���ƥ��å���
|
17
|
+
@[Joystick.open] ��
|
18
|
+
�����ץ�ʤ���Ф����ޤ���
|
19
|
+
|
20
|
+
�����˽�Ƥ����åɤ�Ȥ�����
|
21
|
+
���祤���ƥ��å��ˤ����餫�饢�����������ɤ߹���Τ�
|
22
|
+
���ɤ���ˡ�Τ褦�˻פ��ޤ����������Ƥ��ξ�礽���ǤϤ���ޤ���
|
23
|
+
����Ū�ˤϡ����祤���ƥ��å���@[���٥��|Event]
|
24
|
+
�����ƥ��Ȥä��ɤ߹���٤��Ǥ���
|
25
|
+
������ǽ�ˤ��뤿��ˡ�@[Joystick.poll=]
|
26
|
+
��Ȥäƥ��祤���ƥ��å��Υ��٥�Ƚ������֤����ꤷ�ʤ���Фʤ�ޤ���
|
27
|
+
��������祤���ƥ��å���Ȥ�����@[�����ץ�|Joystick.open]
|
28
|
+
���ʤ���Фʤ�ޤ���
|
29
|
+
|
30
|
+
* NOTES
|
31
|
+
|
32
|
+
���٥�ȥ��塼���̤��ƥ��祤���ƥ��å��äƤ���Τ�
|
33
|
+
((*�ʤ����*))�� @[Joystick.update_all]
|
34
|
+
��Ƥ�ǥ��祤���ƥ��å��ι���������Ū���᤹��ɬ�פ�����ޤ���
|
35
|
+
|
36
|
+
�ե������ե����ɥХå��Ϥޤ����ݡ��Ȥ���Ƥ��ޤ���
|
37
|
+
|
38
|
+
== SDL::Joystick
|
39
|
+
�ġ��Υ��祤���ƥå��������Ͼ�������뤿��Υ��饹�Ǥ���
|
40
|
+
|
41
|
+
METHODS(Joystick)
|
42
|
+
|
43
|
+
== Methods
|
44
|
+
%%%
|
45
|
+
NAME num
|
46
|
+
MOD Joystick
|
47
|
+
TYPE .
|
48
|
+
PURPOSE ���Ѳ�ǽ�ʥ��祤���ƥ��å��ο�������ޤ���
|
49
|
+
RVAL Integer
|
50
|
+
|
51
|
+
PROTO
|
52
|
+
num
|
53
|
+
|
54
|
+
DESC
|
55
|
+
�����ƥ����³���줿���祤���ƥ��å��ο�������ޤ���
|
56
|
+
|
57
|
+
SEEALSO
|
58
|
+
Joystick.index_name
|
59
|
+
Joystick.open
|
60
|
+
|
61
|
+
%%
|
62
|
+
NAME index_name
|
63
|
+
MOD Joystick
|
64
|
+
TYPE .
|
65
|
+
PURPOSE ���祤���ƥ��å�̾��������ޤ���
|
66
|
+
RVAL String
|
67
|
+
|
68
|
+
PROTO
|
69
|
+
index_name(index)
|
70
|
+
indexName(index)
|
71
|
+
|
72
|
+
DESC
|
73
|
+
�����˰�¸���른�祤���ƥ��å�̾��ʸ����Ǽ������ޤ���
|
74
|
+
$[index] �ѥ����ϥ����ƥ��Υ��祤���ƥ��å��ֹ��ؤ��ޤ���
|
75
|
+
|
76
|
+
EXAMPLE
|
77
|
+
# ��³���줿���ƤΥ��祤���ƥ��å���̾����ɽ��
|
78
|
+
num_joy = SDL::Joystick.num
|
79
|
+
printf("%d �ܤΥ��祤���ƥ��å������Ĥ���ޤ���\n", num_joy)
|
80
|
+
num_joy.times do |i|
|
81
|
+
puts SDL::Joystick.index_name(i)
|
82
|
+
end
|
83
|
+
|
84
|
+
SEEALSO
|
85
|
+
Joystick.open
|
86
|
+
|
87
|
+
%%
|
88
|
+
NAME open
|
89
|
+
MOD Joystick
|
90
|
+
TYPE .
|
91
|
+
PURPOSE ���祤���ƥ��å���Ȥ����ᥪ���ץޤ���
|
92
|
+
RVAL SDL::Joystick
|
93
|
+
|
94
|
+
PROTO
|
95
|
+
open(index)
|
96
|
+
|
97
|
+
DESC
|
98
|
+
SDL ��ǥ��祤���ƥ��å���Ȥ����ᥪ���ץޤ���
|
99
|
+
$[index] �ϥ����ƥ�ˤ����른�祤���ƥ��å����ֹ��ؤ��ޤ���
|
100
|
+
���祤���ƥ��å��ϥ�����ǻ��Ѥ������˥����ץ��ɬ�פ�����ޤ���
|
101
|
+
|
102
|
+
���祤���ƥ��å��ֹ�� 0 ���� SDL::Joystick.num - 1 �ޤǤ�ͭ���Ǥ���
|
103
|
+
|
104
|
+
RET
|
105
|
+
@[Joystick]�Υ������֤��ޤ���
|
106
|
+
|
107
|
+
EXCEPTION *
|
108
|
+
|
109
|
+
EXAMPLE
|
110
|
+
# ���祤���ƥ��å������뤫�����å�
|
111
|
+
if SDL::Joystick.num > 0
|
112
|
+
# ���祤���ƥ��å����ץ�
|
113
|
+
joy = SDL::Joystick.open(0)
|
114
|
+
|
115
|
+
printf("0�֤Υ��祤���ƥ��å����ޤ���\n");
|
116
|
+
printf("̾��: %s\n", SDL::Joystick.name(0))
|
117
|
+
printf("���ο�: %d\n", joy.num_axes)
|
118
|
+
printf("�ܥ���ο�: %d\n", joy.num_buttons)
|
119
|
+
printf("�ܡ���ο�: %d\n", joy.num_balls)
|
120
|
+
end
|
121
|
+
|
122
|
+
%%
|
123
|
+
NAME open?
|
124
|
+
MOD Joystick
|
125
|
+
TYPE .
|
126
|
+
PURPOSE ���祤���ƥ��å��������ץ�Ƥ��뤫�ɤ�����Ĵ�٤ޤ���
|
127
|
+
RVAL true/false
|
128
|
+
|
129
|
+
PROTO
|
130
|
+
open?(index)
|
131
|
+
|
132
|
+
DESC
|
133
|
+
���ץꥱ����������ǥ��祤���ƥ��å��������ץ�Ƥ��뤫�ɤ�����Ĵ�٤ޤ���
|
134
|
+
$[index] �ϥ����ƥ�ˤ����른�祤���ƥ��å����ֹ��ؤ��ޤ���
|
135
|
+
|
136
|
+
RET
|
137
|
+
���祤���ƥ��å������˥����ץ�Ƥ������ true ��
|
138
|
+
�����Ǥʤ����� false ���֤��ޤ���
|
139
|
+
|
140
|
+
SEEALSO
|
141
|
+
Joystick.open
|
142
|
+
|
143
|
+
%%
|
144
|
+
NAME index
|
145
|
+
MOD Joystick
|
146
|
+
TYPE #
|
147
|
+
PURPOSE ���祤���ƥ��å��Υ���ǥå����ֹ���֤��ޤ���
|
148
|
+
RVAL Integer
|
149
|
+
|
150
|
+
PROTO
|
151
|
+
index
|
152
|
+
|
153
|
+
DESC
|
154
|
+
$[self] �Υ���ǥå����ֹ���֤��ޤ���
|
155
|
+
|
156
|
+
%%
|
157
|
+
NAME num_axes
|
158
|
+
MOD Joystick
|
159
|
+
TYPE #
|
160
|
+
PURPOSE ���祤���ƥ��å��μ��ο���������ޤ���
|
161
|
+
RVAL Integer
|
162
|
+
|
163
|
+
PROTO
|
164
|
+
num_axes
|
165
|
+
numAxes
|
166
|
+
|
167
|
+
DESC
|
168
|
+
���Ѳ�ǽ�ʼ��ο����֤��ޤ���
|
169
|
+
|
170
|
+
NOTES
|
171
|
+
�ļ��Ȳ�������Ĥ褦����������(�����륢�ʥ������ƥ��å�)�ϼ���
|
172
|
+
2�Ĥȿ������ޤ���
|
173
|
+
|
174
|
+
SEEALSO
|
175
|
+
Joystick#axis
|
176
|
+
|
177
|
+
%%
|
178
|
+
NAME num_balls
|
179
|
+
MOD Joystick
|
180
|
+
TYPE #
|
181
|
+
PURPOSE ���祤���ƥ��å��Υȥ�å��ܡ���ο���������ޤ���
|
182
|
+
RVAL Integer
|
183
|
+
|
184
|
+
PROTO
|
185
|
+
num_balls
|
186
|
+
numBalls
|
187
|
+
|
188
|
+
DESC
|
189
|
+
���Ѳ�ǽ�ʥȥ�å��ܡ���ο����֤��ޤ���
|
190
|
+
|
191
|
+
SEEALSO
|
192
|
+
Joystick#ball
|
193
|
+
|
194
|
+
%%
|
195
|
+
NAME num_hats
|
196
|
+
MOD Joystick
|
197
|
+
TYPE #
|
198
|
+
PURPOSE ���祤���ƥ��å��Υϥåȥ����å��ο���������ޤ���
|
199
|
+
RVAL Integer
|
200
|
+
|
201
|
+
PROTO
|
202
|
+
num_hats
|
203
|
+
numHats
|
204
|
+
|
205
|
+
DESC
|
206
|
+
���Ѳ�ǽ�ʥϥåȥ����å��ο����֤��ޤ���
|
207
|
+
|
208
|
+
SEEALSO
|
209
|
+
Joystick#hat
|
210
|
+
|
211
|
+
%%
|
212
|
+
NAME num_buttons
|
213
|
+
MOD Joystick
|
214
|
+
TYPE #
|
215
|
+
PURPOSE ���祤���ƥ��å��Υܥ���ο���������ޤ���
|
216
|
+
RVAL Integer
|
217
|
+
|
218
|
+
PROTO
|
219
|
+
num_buttons
|
220
|
+
numButtons
|
221
|
+
|
222
|
+
DESC
|
223
|
+
���Ѳ�ǽ�ʥܥ���ο����֤��ޤ���
|
224
|
+
|
225
|
+
SEEALSO
|
226
|
+
Joystick#button
|
227
|
+
|
228
|
+
%%
|
229
|
+
NAME poll=
|
230
|
+
MOD Joystick
|
231
|
+
TYPE .
|
232
|
+
PURPOSE ���祤���ƥ��å����٥�ȤΥݡ����ͭ��/̵���ˤ��ޤ���
|
233
|
+
|
234
|
+
PROTO
|
235
|
+
poll=(enable)
|
236
|
+
|
237
|
+
DESC
|
238
|
+
���祤���ƥ��å����٥�Ȥν�����ͭ���ޤ���̵���ˤ��뤿��˻Ȥ��ޤ���
|
239
|
+
���祤���ƥ��å����٥�Ȥν�����̵���ξ��֤Ǥϡ�@[Joystick.update_all]
|
240
|
+
��Ȥäƥ��祤���ƥ��å��ξ��֤�����
|
241
|
+
��ư�ǥ��祤���ƥ��å��ξ�����ɤ߹���ɬ�פ�����ޤ���
|
242
|
+
|
243
|
+
�ǥե���ȤǤ�ͭ���ˤʤäƤ��ޤ���
|
244
|
+
|
245
|
+
SEEALSO
|
246
|
+
Joystick.update_all
|
247
|
+
Joystick.poll
|
248
|
+
Event2::JoyAxis
|
249
|
+
Event2::JoyBall
|
250
|
+
Event2::JoyButtonDown
|
251
|
+
Event2::JoyButtonUp
|
252
|
+
Event2::JoyHat
|
253
|
+
|
254
|
+
%%
|
255
|
+
NAME poll
|
256
|
+
MOD Joystick
|
257
|
+
TYPE .
|
258
|
+
PURPOSE ���祤���ƥ��å����٥�ȤΥݡ����ͭ�����ɤ�����Ĵ�٤ޤ���
|
259
|
+
RVAL true/false
|
260
|
+
|
261
|
+
PROTO
|
262
|
+
poll
|
263
|
+
|
264
|
+
DESC
|
265
|
+
���祤���ƥ��å����٥�Ȥν�����ͭ���ʤ�� true ��̵���ʤ� false ���֤�
|
266
|
+
�ޤ����ܤ����� @[Joystick.poll=] �Ƥ���������
|
267
|
+
|
268
|
+
%%
|
269
|
+
NAME update_all
|
270
|
+
MOD Joystick
|
271
|
+
TYPE .
|
272
|
+
PURPOSE ���٤ƤΥ��祤���ƥ��å��ξ��֤����ޤ���
|
273
|
+
|
274
|
+
PROTO
|
275
|
+
update_all
|
276
|
+
updateAll
|
277
|
+
|
278
|
+
DESC
|
279
|
+
�����ץ줿���٤ƤΥ��祤���ƥ��å��ξ���(���֡��ܥ���ʤ�)�����ޤ���
|
280
|
+
@[Joystick.poll=]
|
281
|
+
�ˤ�äƥ��祤���ƥ��å����٥�Ȥ�ͭ���ˤʤäƤ�����ϡ�
|
282
|
+
���٥�ȥ롼�פ���Ǽ�ưŪ�˸ƤФ�ޤ���
|
283
|
+
|
284
|
+
%%
|
285
|
+
NAME axis
|
286
|
+
MOD Joystick
|
287
|
+
TYPE #
|
288
|
+
PURPOSE ���θ��ߤξ��֤�������ޤ���
|
289
|
+
RVAL Integer
|
290
|
+
|
291
|
+
PROTO
|
292
|
+
axis(axis_index)
|
293
|
+
|
294
|
+
DESC
|
295
|
+
$[self] ��$[axis_index] �ǻ��ꤷ�����θ��ߤξ��֤��֤��ޤ���
|
296
|
+
|
297
|
+
�Ƕ�ΤۤȤ�ɤΥ��祤���ƥ��å��Ǥϡ�
|
298
|
+
X �����̾� axis 0��
|
299
|
+
Y ���� axis 1 ��ɽ������Ƥ��ޤ���
|
300
|
+
���Υ�åɤˤ�ä��֤�����ͤϡ����θ��ߤΰ��֤�ɽ�魯
|
301
|
+
����դ����� (-32768 ���� 32768 �ޤ�) �Ǥ��ꡢ
|
302
|
+
�֤���θ���뤿�ᤳ�����ͤ�Ŭ�������ͤ����ꤷ�Ƥ���ɬ�פ�����Ǥ��礦��
|
303
|
+
|
304
|
+
EXAMPLE
|
305
|
+
joy = SDL::Joystick.open(0)
|
306
|
+
.
|
307
|
+
.
|
308
|
+
x_move = joy.axis(0)
|
309
|
+
y_move = joy.axis(1)
|
310
|
+
|
311
|
+
SEEALSO
|
312
|
+
Joystick#num_axes
|
313
|
+
|
314
|
+
%%
|
315
|
+
NAME hat
|
316
|
+
MOD Joystick
|
317
|
+
TYPE #
|
318
|
+
PURPOSE ���祤���ƥ��å��Υϥåȥ����å��θ��ߤξ��֤�������ޤ���
|
319
|
+
RVAL UINT
|
320
|
+
|
321
|
+
PROTO
|
322
|
+
hat(hat_index)
|
323
|
+
|
324
|
+
DESC
|
325
|
+
$[hat_index] �ǻ��ꤷ���ϥåȥ����å��θ��ߤξ��֤�������ޤ���
|
326
|
+
|
327
|
+
RET
|
328
|
+
���ߤξ��֤ϡ�
|
329
|
+
�ʲ��˵��ͤ� 1 �Ĥޤ���ʣ���� OR �ˤ���Ȥ߹�碌�Ȥ���
|
330
|
+
�����������̵���������ͤȤ����֤���ޤ���
|
331
|
+
|
332
|
+
* SDL::Joystick::HAT_CENTERED
|
333
|
+
* SDL::Joystick::HAT_UP
|
334
|
+
* SDL::Joystick::HAT_RIGHT
|
335
|
+
* SDL::Joystick::HAT_DOWN
|
336
|
+
* SDL::Joystick::HAT_LEFT
|
337
|
+
* SDL::Joystick::HAT_RIGHTUP
|
338
|
+
* SDL::Joystick::HAT_RIGHTDOWN
|
339
|
+
* SDL::Joystick::HAT_LEFTUP
|
340
|
+
* SDL::Joystick::HAT_LEFTDOWN
|
341
|
+
|
342
|
+
SEEALSO
|
343
|
+
Joystick#num_hats
|
344
|
+
|
345
|
+
%%
|
346
|
+
NAME button
|
347
|
+
MOD Joystick
|
348
|
+
TYPE #
|
349
|
+
PURPOSE ���ꤵ�줿�ܥ���θ��ߤξ�����֤��ޤ���
|
350
|
+
RVAL true/false
|
351
|
+
|
352
|
+
PROTO
|
353
|
+
button(button_index)
|
354
|
+
|
355
|
+
DESC
|
356
|
+
$[button_index] �ǻ��ꤵ�줿�ܥ���θ��ߤξ�����֤��ޤ���
|
357
|
+
�ܥ��������֤ˤ������ true ��Υ����Ƥ������ false ��
|
358
|
+
�֤��ޤ���
|
359
|
+
|
360
|
+
SEEALSO
|
361
|
+
Joystick#num_buttons
|
362
|
+
|
363
|
+
%%
|
364
|
+
NAME ball
|
365
|
+
MOD Joystick
|
366
|
+
TYPE #
|
367
|
+
PURPOSE �ȥ�å��ܡ��������Ū��ư����������ޤ���
|
368
|
+
RVAL [Integer, Integer]
|
369
|
+
|
370
|
+
PROTO
|
371
|
+
ball(ball_index)
|
372
|
+
|
373
|
+
DESC
|
374
|
+
$[ball_index] �ǻ��ꤷ���ܡ��������Ū���Ѳ���������ޤ���
|
375
|
+
|
376
|
+
�ȥ�å��ܡ����
|
377
|
+
����Τ��Υ�åɤθƤӽФ������
|
378
|
+
����Ū��ư���������֤����Ȥ��Ǥ���������ư�����Ѳ���
|
379
|
+
[dx, dy] �Ȥ�����������2�Ĥ�����������ޤ���
|
380
|
+
|
381
|
+
EXCEPTION *
|
382
|
+
|
383
|
+
EXAMPLE
|
384
|
+
delta_x, delta_y = joy.ball(0)
|
385
|
+
printf("�ȥ�å��ܡ�������а�ư��- X:%d, Y:%d\n", delta_x, delta_y)
|
386
|
+
|
387
|
+
|