sfml3-rb 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/CHANGELOG.md +43 -17
- data/README.md +97 -29
- data/ext/audio/audio_enums.c +58 -20
- data/ext/audio/listener.c +89 -6
- data/ext/audio/music.c +206 -5
- data/ext/audio/sound.c +175 -5
- data/ext/audio/sound_buffer.c +189 -47
- data/ext/audio/sound_buffer_recorder.c +83 -16
- data/ext/audio/sound_recorder.c +172 -52
- data/ext/audio/sound_source_cone.c +108 -29
- data/ext/audio/sound_stream.c +178 -5
- data/ext/core/exceptions.c +10 -8
- data/ext/core/unicode.c +12 -2
- data/ext/ext.c +4 -0
- data/ext/graphics/blend_mode.c +203 -53
- data/ext/graphics/circle.c +271 -4
- data/ext/graphics/color.c +240 -90
- data/ext/graphics/drawable.c +15 -4
- data/ext/graphics/font.c +138 -25
- data/ext/graphics/glyph.c +31 -8
- data/ext/graphics/image.c +180 -37
- data/ext/graphics/polygon.c +293 -26
- data/ext/graphics/rect.c +211 -54
- data/ext/graphics/rectangle.c +279 -26
- data/ext/graphics/render_state.c +116 -2
- data/ext/graphics/render_texture.c +163 -2
- data/ext/graphics/shader.c +283 -17
- data/ext/graphics/shape.c +252 -26
- data/ext/graphics/sprite.c +216 -25
- data/ext/graphics/stencil_mode.c +148 -39
- data/ext/graphics/target.c +67 -22
- data/ext/graphics/target.h +15 -15
- data/ext/graphics/text.c +306 -6
- data/ext/graphics/texture.c +257 -3
- data/ext/graphics/transform.c +178 -5
- data/ext/graphics/transformable.c +126 -2
- data/ext/graphics/vertex.c +79 -2
- data/ext/graphics/vertex_array.c +128 -16
- data/ext/graphics/vertex_buffer.c +124 -2
- data/ext/graphics/view.c +130 -2
- data/ext/network/ftp.c +249 -10
- data/ext/network/http.c +156 -38
- data/ext/network/ip_address.c +107 -26
- data/ext/network/network_enums.c +248 -141
- data/ext/network/packet.c +273 -39
- data/ext/network/socket_selector.c +91 -19
- data/ext/network/tcp_listener.c +75 -16
- data/ext/network/tcp_socket.c +128 -25
- data/ext/network/udp_socket.c +122 -26
- data/ext/ports.rb +7 -0
- data/ext/system/buffer.c +41 -12
- data/ext/system/clock.c +68 -9
- data/ext/system/input_stream.c +94 -42
- data/ext/system/sleep.c +10 -2
- data/ext/system/time.c +172 -34
- data/ext/system/vec2.c +156 -35
- data/ext/system/vec3.c +166 -35
- data/ext/window/clipboard.c +47 -17
- data/ext/window/context.c +59 -9
- data/ext/window/context_settings.c +116 -38
- data/ext/window/cursor.c +39 -9
- data/ext/window/event.c +163 -42
- data/ext/window/joystick.c +69 -3
- data/ext/window/keyboard.c +168 -116
- data/ext/window/mouse.c +36 -2
- data/ext/window/sensor.c +28 -2
- data/ext/window/touch.c +20 -2
- data/ext/window/video_mode.c +90 -19
- data/ext/window/vulkan.c +34 -6
- data/ext/window/window.c +340 -16
- data/lib/sfml/version.rb +1 -1
- data/sig/audio/audio_enums.rbs +30 -0
- data/sig/audio/listener.rbs +16 -0
- data/sig/audio/music.rbs +56 -0
- data/sig/audio/sound.rbs +51 -0
- data/sig/audio/sound_buffer.rbs +17 -0
- data/sig/audio/sound_buffer_recorder.rbs +14 -0
- data/sig/audio/sound_recorder.rbs +17 -0
- data/sig/audio/sound_source_cone.rbs +14 -0
- data/sig/audio/sound_stream.rbs +51 -0
- data/sig/graphics/blend_mode.rbs +29 -0
- data/sig/graphics/circle.rbs +44 -0
- data/sig/graphics/color.rbs +39 -0
- data/sig/graphics/drawable.rbs +5 -0
- data/sig/graphics/font.rbs +20 -0
- data/sig/graphics/glyph.rbs +7 -0
- data/sig/graphics/image.rbs +22 -0
- data/sig/graphics/polygon.rbs +42 -0
- data/sig/graphics/rect.rbs +33 -0
- data/sig/graphics/rectangle.rbs +42 -0
- data/sig/graphics/render_state.rbs +21 -0
- data/sig/graphics/render_texture.rbs +37 -0
- data/sig/graphics/shader.rbs +39 -0
- data/sig/graphics/shape.rbs +38 -0
- data/sig/graphics/sprite.rbs +34 -0
- data/sig/graphics/stencil_mode.rbs +18 -0
- data/sig/graphics/target.rbs +10 -0
- data/sig/graphics/text.rbs +48 -0
- data/sig/graphics/texture.rbs +34 -0
- data/sig/graphics/transform.rbs +37 -0
- data/sig/graphics/transformable.rbs +25 -0
- data/sig/graphics/vertex.rbs +17 -0
- data/sig/graphics/vertex_array.rbs +17 -0
- data/sig/graphics/vertex_buffer.rbs +22 -0
- data/sig/graphics/view.rbs +24 -0
- data/sig/network/ftp.rbs +46 -0
- data/sig/network/http.rbs +27 -0
- data/sig/network/ip_address.rbs +22 -0
- data/sig/network/network_enums.rbs +95 -0
- data/sig/network/packet.rbs +40 -0
- data/sig/network/socket_selector.rbs +14 -0
- data/sig/network/tcp_listener.rbs +13 -0
- data/sig/network/tcp_socket.rbs +18 -0
- data/sig/network/udp_socket.rbs +17 -0
- data/sig/system/buffer.rbs +11 -0
- data/sig/system/clock.rbs +13 -0
- data/sig/system/input_stream.rbs +7 -0
- data/sig/system/sleep.rbs +3 -0
- data/sig/system/time.rbs +28 -0
- data/sig/system/vec2.rbs +26 -0
- data/sig/system/vec3.rbs +27 -0
- data/sig/window/clipboard.rbs +8 -0
- data/sig/window/context.rbs +11 -0
- data/sig/window/context_settings.rbs +20 -0
- data/sig/window/cursor.rbs +6 -0
- data/sig/window/event.rbs +20 -0
- data/sig/window/joystick.rbs +15 -0
- data/sig/window/keyboard.rbs +10 -0
- data/sig/window/mouse.rbs +9 -0
- data/sig/window/sensor.rbs +8 -0
- data/sig/window/touch.rbs +6 -0
- data/sig/window/video_mode.rbs +16 -0
- data/sig/window/vulkan.rbs +7 -0
- data/sig/window/window.rbs +57 -0
- metadata +66 -2
data/sig/audio/sound.rbs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Sound
|
|
3
|
+
def self.new: (SoundBuffer buffer) -> Sound
|
|
4
|
+
|
|
5
|
+
def copy: () -> Sound
|
|
6
|
+
def buffer: () -> SoundBuffer
|
|
7
|
+
def buffer=: (SoundBuffer value) -> SoundBuffer
|
|
8
|
+
|
|
9
|
+
def play: () -> self
|
|
10
|
+
def pause: () -> self
|
|
11
|
+
def stop: () -> self
|
|
12
|
+
def status: () -> (:stopped | :paused | :playing)
|
|
13
|
+
def looping?: () -> bool
|
|
14
|
+
def looping=: (bool value) -> bool
|
|
15
|
+
def pitch: () -> Float
|
|
16
|
+
def pitch=: (Float value) -> Float
|
|
17
|
+
def pan: () -> Float
|
|
18
|
+
def pan=: (Float value) -> Float
|
|
19
|
+
def volume: () -> Float
|
|
20
|
+
def volume=: (Float value) -> Float
|
|
21
|
+
def spatialization_enabled?: () -> bool
|
|
22
|
+
def spatialization_enabled=: (bool value) -> bool
|
|
23
|
+
def position: () -> Vector3
|
|
24
|
+
def position=: (Vector3 value) -> Vector3
|
|
25
|
+
def direction: () -> Vector3
|
|
26
|
+
def direction=: (Vector3 value) -> Vector3
|
|
27
|
+
def velocity: () -> Vector3
|
|
28
|
+
def velocity=: (Vector3 value) -> Vector3
|
|
29
|
+
def cone: () -> SoundSourceCone
|
|
30
|
+
def cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
31
|
+
def doppler_factor: () -> Float
|
|
32
|
+
def doppler_factor=: (Float value) -> Float
|
|
33
|
+
def directional_attenuation_factor: () -> Float
|
|
34
|
+
def directional_attenuation_factor=: (Float value) -> Float
|
|
35
|
+
def relative_to_listener?: () -> bool
|
|
36
|
+
def relative_to_listener=: (bool value) -> bool
|
|
37
|
+
def min_distance: () -> Float
|
|
38
|
+
def min_distance=: (Float value) -> Float
|
|
39
|
+
def max_distance: () -> Float
|
|
40
|
+
def max_distance=: (Float value) -> Float
|
|
41
|
+
def min_gain: () -> Float
|
|
42
|
+
def min_gain=: (Float value) -> Float
|
|
43
|
+
def max_gain: () -> Float
|
|
44
|
+
def max_gain=: (Float value) -> Float
|
|
45
|
+
def attenuation: () -> Float
|
|
46
|
+
def attenuation=: (Float value) -> Float
|
|
47
|
+
def playing_offset: () -> Time
|
|
48
|
+
def playing_offset=: (Time value) -> Time
|
|
49
|
+
def effect_processor=: (Proc proc) -> Proc
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundBuffer
|
|
3
|
+
def self.from_file: (String path) -> SoundBuffer
|
|
4
|
+
def self.from_memory: (String data) -> SoundBuffer
|
|
5
|
+
def self.from_stream: (untyped stream) -> SoundBuffer
|
|
6
|
+
def self.from_samples: (Array[Integer] | String samples, Integer channel_count, Integer sample_rate, ?Array[Symbol] channel_map) -> SoundBuffer
|
|
7
|
+
|
|
8
|
+
def copy: () -> SoundBuffer
|
|
9
|
+
def save_to_file: (String path) -> bool
|
|
10
|
+
def samples: () -> Array[Integer]
|
|
11
|
+
def sample_count: () -> Integer
|
|
12
|
+
def sample_rate: () -> Integer
|
|
13
|
+
def channel_count: () -> Integer
|
|
14
|
+
def channel_map: () -> Array[Symbol]
|
|
15
|
+
def duration: () -> Time
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundBufferRecorder
|
|
3
|
+
def self.new: () -> SoundBufferRecorder
|
|
4
|
+
|
|
5
|
+
def start: (Integer sample_rate) -> bool
|
|
6
|
+
def stop: () -> self
|
|
7
|
+
def sample_rate: () -> Integer
|
|
8
|
+
def buffer: () -> SoundBuffer
|
|
9
|
+
def device: () -> String
|
|
10
|
+
def device=: (String value) -> bool
|
|
11
|
+
def channel_count: () -> Integer
|
|
12
|
+
def channel_count=: (Integer value) -> Integer
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundRecorder
|
|
3
|
+
def self.new: () -> SoundRecorder
|
|
4
|
+
def self.available?: () -> bool
|
|
5
|
+
def self.available_devices: () -> Array[String]
|
|
6
|
+
def self.default_device: () -> String?
|
|
7
|
+
|
|
8
|
+
def start: (Integer sample_rate) -> bool
|
|
9
|
+
def stop: () -> self
|
|
10
|
+
def sample_rate: () -> Integer
|
|
11
|
+
def device: () -> String?
|
|
12
|
+
def device=: (String value) -> bool
|
|
13
|
+
def channel_count: () -> Integer
|
|
14
|
+
def channel_count=: (Integer value) -> Integer
|
|
15
|
+
def channel_map: () -> Array[Symbol]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundSourceCone
|
|
3
|
+
def self.new: (Float inner_angle, Float outer_angle, Float outer_gain) -> SoundSourceCone
|
|
4
|
+
|
|
5
|
+
def inner_angle: () -> Float
|
|
6
|
+
def inner_angle=: (Float value) -> Float
|
|
7
|
+
def outer_angle: () -> Float
|
|
8
|
+
def outer_angle=: (Float value) -> Float
|
|
9
|
+
def outer_gain: () -> Float
|
|
10
|
+
def outer_gain=: (Float value) -> Float
|
|
11
|
+
def to_a: () -> [Float, Float, Float]
|
|
12
|
+
def ==: (untyped other) -> bool
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundStream
|
|
3
|
+
def self.new: (Integer channel_count, Integer sample_rate, ?Array[Symbol] channel_map) -> SoundStream
|
|
4
|
+
|
|
5
|
+
def channel_count: () -> Integer
|
|
6
|
+
def sample_rate: () -> Integer
|
|
7
|
+
def channel_map: () -> Array[Symbol]
|
|
8
|
+
|
|
9
|
+
def play: () -> self
|
|
10
|
+
def pause: () -> self
|
|
11
|
+
def stop: () -> self
|
|
12
|
+
def status: () -> (:stopped | :paused | :playing)
|
|
13
|
+
def looping?: () -> bool
|
|
14
|
+
def looping=: (bool value) -> bool
|
|
15
|
+
def pitch: () -> Float
|
|
16
|
+
def pitch=: (Float value) -> Float
|
|
17
|
+
def pan: () -> Float
|
|
18
|
+
def pan=: (Float value) -> Float
|
|
19
|
+
def volume: () -> Float
|
|
20
|
+
def volume=: (Float value) -> Float
|
|
21
|
+
def spatialization_enabled?: () -> bool
|
|
22
|
+
def spatialization_enabled=: (bool value) -> bool
|
|
23
|
+
def position: () -> Vector3
|
|
24
|
+
def position=: (Vector3 value) -> Vector3
|
|
25
|
+
def direction: () -> Vector3
|
|
26
|
+
def direction=: (Vector3 value) -> Vector3
|
|
27
|
+
def velocity: () -> Vector3
|
|
28
|
+
def velocity=: (Vector3 value) -> Vector3
|
|
29
|
+
def cone: () -> SoundSourceCone
|
|
30
|
+
def cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
31
|
+
def doppler_factor: () -> Float
|
|
32
|
+
def doppler_factor=: (Float value) -> Float
|
|
33
|
+
def directional_attenuation_factor: () -> Float
|
|
34
|
+
def directional_attenuation_factor=: (Float value) -> Float
|
|
35
|
+
def relative_to_listener?: () -> bool
|
|
36
|
+
def relative_to_listener=: (bool value) -> bool
|
|
37
|
+
def min_distance: () -> Float
|
|
38
|
+
def min_distance=: (Float value) -> Float
|
|
39
|
+
def max_distance: () -> Float
|
|
40
|
+
def max_distance=: (Float value) -> Float
|
|
41
|
+
def min_gain: () -> Float
|
|
42
|
+
def min_gain=: (Float value) -> Float
|
|
43
|
+
def max_gain: () -> Float
|
|
44
|
+
def max_gain=: (Float value) -> Float
|
|
45
|
+
def attenuation: () -> Float
|
|
46
|
+
def attenuation=: (Float value) -> Float
|
|
47
|
+
def playing_offset: () -> Time
|
|
48
|
+
def playing_offset=: (Time value) -> Time
|
|
49
|
+
def effect_processor=: (Proc proc) -> Proc
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class BlendMode
|
|
3
|
+
def self.new: () -> BlendMode
|
|
4
|
+
| (Symbol | Integer color_src_factor, Symbol | Integer color_dst_factor,
|
|
5
|
+
Symbol | Integer color_equation, Symbol | Integer alpha_src_factor,
|
|
6
|
+
Symbol | Integer alpha_dst_factor, Symbol | Integer alpha_equation) -> BlendMode
|
|
7
|
+
|
|
8
|
+
def color_src_factor: () -> Symbol
|
|
9
|
+
def color_src_factor=: (Symbol | Integer value) -> Symbol
|
|
10
|
+
def color_dst_factor: () -> Symbol
|
|
11
|
+
def color_dst_factor=: (Symbol | Integer value) -> Symbol
|
|
12
|
+
def color_equation: () -> Symbol
|
|
13
|
+
def color_equation=: (Symbol | Integer value) -> Symbol
|
|
14
|
+
def alpha_src_factor: () -> Symbol
|
|
15
|
+
def alpha_src_factor=: (Symbol | Integer value) -> Symbol
|
|
16
|
+
def alpha_dst_factor: () -> Symbol
|
|
17
|
+
def alpha_dst_factor=: (Symbol | Integer value) -> Symbol
|
|
18
|
+
def alpha_equation: () -> Symbol
|
|
19
|
+
def alpha_equation=: (Symbol | Integer value) -> Symbol
|
|
20
|
+
def ==: (untyped other) -> bool
|
|
21
|
+
|
|
22
|
+
NONE: BlendMode
|
|
23
|
+
ALPHA: BlendMode
|
|
24
|
+
ADD: BlendMode
|
|
25
|
+
MULTIPLY: BlendMode
|
|
26
|
+
MIN: BlendMode
|
|
27
|
+
MAX: BlendMode
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Circle
|
|
3
|
+
include Drawable
|
|
4
|
+
|
|
5
|
+
def self.new: (?Float radius) -> Circle
|
|
6
|
+
|
|
7
|
+
def copy: () -> Circle
|
|
8
|
+
def move: (Vector2 | Array[Float] offset) -> self
|
|
9
|
+
def rotate: (Float angle) -> self
|
|
10
|
+
def scale!: (Vector2 | Array[Float] factors) -> self
|
|
11
|
+
def draw: (untyped target, RenderState state) -> nil
|
|
12
|
+
|
|
13
|
+
def radius=: (Float value) -> Float
|
|
14
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
15
|
+
def rotation=: (Float value) -> Float
|
|
16
|
+
def scale=: (Vector2 | Array[Float] value) -> Vector2
|
|
17
|
+
def origin=: (Vector2 | Array[Float] value) -> Vector2
|
|
18
|
+
def fill_color=: (Color value) -> Color
|
|
19
|
+
def outline_color=: (Color value) -> Color
|
|
20
|
+
def outline_thickness=: (Float value) -> Float
|
|
21
|
+
def texture=: (Texture? value) -> Texture?
|
|
22
|
+
def texture_rect=: (Rect value) -> Rect
|
|
23
|
+
def point_count=: (Integer value) -> self
|
|
24
|
+
|
|
25
|
+
def radius: () -> Float
|
|
26
|
+
def position: () -> Vector2
|
|
27
|
+
def rotation: () -> Float
|
|
28
|
+
def scale: () -> Vector2
|
|
29
|
+
def origin: () -> Vector2
|
|
30
|
+
def fill_color: () -> Color
|
|
31
|
+
def outline_color: () -> Color
|
|
32
|
+
def outline_thickness: () -> Float
|
|
33
|
+
def texture: () -> (Texture | nil)
|
|
34
|
+
def texture_rect: () -> Rect
|
|
35
|
+
def point_count: () -> Integer
|
|
36
|
+
def point: (Integer index) -> Vector2
|
|
37
|
+
def geometric_center: () -> Vector2
|
|
38
|
+
def local_bounds: () -> Rect
|
|
39
|
+
def global_bounds: () -> Rect
|
|
40
|
+
def transform: () -> Array[untyped]
|
|
41
|
+
def inverse_transform: () -> Array[untyped]
|
|
42
|
+
def matrix: () -> Array[untyped]
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Color
|
|
3
|
+
def self.new: () -> Color
|
|
4
|
+
| (Integer r, Integer g, Integer b, ?Integer a) -> Color
|
|
5
|
+
| (Array[Integer] rgb_or_rgba) -> Color
|
|
6
|
+
| (Integer packed) -> Color
|
|
7
|
+
| (Color other) -> Color
|
|
8
|
+
def self.from_rgb: (Integer rgb) -> Color
|
|
9
|
+
def self.from_rgba: (Integer rgba) -> Color
|
|
10
|
+
def self.from_integer: (Integer rgba) -> Color
|
|
11
|
+
|
|
12
|
+
def r: () -> Integer
|
|
13
|
+
def r=: (Integer value) -> Integer
|
|
14
|
+
def g: () -> Integer
|
|
15
|
+
def g=: (Integer value) -> Integer
|
|
16
|
+
def b: () -> Integer
|
|
17
|
+
def b=: (Integer value) -> Integer
|
|
18
|
+
def a: () -> Integer
|
|
19
|
+
def a=: (Integer value) -> Integer
|
|
20
|
+
def to_i: () -> Integer
|
|
21
|
+
def to_a: () -> [Integer, Integer, Integer, Integer]
|
|
22
|
+
def to_ary: () -> [Integer, Integer, Integer, Integer]
|
|
23
|
+
def ==: (untyped other) -> bool
|
|
24
|
+
def +: (Color | Array[Integer] | Integer other) -> Color
|
|
25
|
+
def -: (Color | Array[Integer] | Integer other) -> Color
|
|
26
|
+
def *: (Color | Array[Integer] | Integer other) -> Color
|
|
27
|
+
def to_s: () -> String
|
|
28
|
+
|
|
29
|
+
BLACK: Color
|
|
30
|
+
WHITE: Color
|
|
31
|
+
RED: Color
|
|
32
|
+
GREEN: Color
|
|
33
|
+
BLUE: Color
|
|
34
|
+
YELLOW: Color
|
|
35
|
+
MAGENTA: Color
|
|
36
|
+
CYAN: Color
|
|
37
|
+
TRANSPARENT: Color
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Font
|
|
3
|
+
def self.from_file: (String path) -> Font
|
|
4
|
+
def self.from_memory: (String data) -> Font
|
|
5
|
+
def self.from_stream: (untyped stream) -> Font
|
|
6
|
+
|
|
7
|
+
def copy: () -> Font
|
|
8
|
+
def glyph: (Integer codepoint, Integer size, ?bool bold, ?Float outline_thickness) -> Glyph
|
|
9
|
+
def has_glyph?: (Integer codepoint) -> bool
|
|
10
|
+
def kerning: (Integer first, Integer second, Integer size) -> Float
|
|
11
|
+
def bold_kerning: (Integer first, Integer second, Integer size) -> Float
|
|
12
|
+
def line_spacing: (Integer size) -> Float
|
|
13
|
+
def underline_position: (Integer size) -> Float
|
|
14
|
+
def underline_thickness: (Integer size) -> Float
|
|
15
|
+
def texture: (Integer size) -> Texture
|
|
16
|
+
def smooth=: (bool value) -> bool
|
|
17
|
+
def smooth?: () -> bool
|
|
18
|
+
def info: () -> String
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Image
|
|
3
|
+
def self.new: (Vector2 | Array[Integer] size) -> Image
|
|
4
|
+
def self.from_color: (Vector2 | Array[Integer] size, Color color) -> Image
|
|
5
|
+
def self.from_pixels: (Vector2 | Array[Integer] size, String pixels) -> Image
|
|
6
|
+
def self.from_file: (String path) -> Image
|
|
7
|
+
def self.from_memory: (String data) -> Image
|
|
8
|
+
def self.from_stream: (untyped stream) -> Image
|
|
9
|
+
|
|
10
|
+
def copy: () -> Image
|
|
11
|
+
def size: () -> Vector2
|
|
12
|
+
def save_to_file: (String path) -> bool
|
|
13
|
+
def save_to_memory: (?String format) -> (Buffer | nil)
|
|
14
|
+
def create_mask_from_color: (Color color, Integer alpha) -> self
|
|
15
|
+
def copy_image: (Image source, Vector2 | Array[Integer] dest, ?Rect source_rect, ?bool apply_alpha) -> bool
|
|
16
|
+
def pixel: (Integer x, Integer y) -> Color
|
|
17
|
+
def set_pixel: (Integer x, Integer y, Color color) -> self
|
|
18
|
+
def pixels: () -> String
|
|
19
|
+
def flip_horizontally!: () -> self
|
|
20
|
+
def flip_vertically!: () -> self
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class ConvexShape
|
|
3
|
+
include Drawable
|
|
4
|
+
|
|
5
|
+
def self.new: (?Integer point_count) -> ConvexShape
|
|
6
|
+
|
|
7
|
+
def copy: () -> ConvexShape
|
|
8
|
+
def move: (Vector2 | Array[Float] offset) -> self
|
|
9
|
+
def rotate: (Float angle) -> self
|
|
10
|
+
def scale!: (Vector2 | Array[Float] factors) -> self
|
|
11
|
+
def draw: (untyped target, RenderState state) -> nil
|
|
12
|
+
|
|
13
|
+
def point_count: () -> Integer
|
|
14
|
+
def point_count=: (Integer value) -> Integer
|
|
15
|
+
def point: (Integer index) -> Vector2
|
|
16
|
+
def set_point: (Integer index, Vector2 | Array[Float] point) -> Vector2
|
|
17
|
+
def position: () -> Vector2
|
|
18
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
19
|
+
def rotation: () -> Float
|
|
20
|
+
def rotation=: (Float value) -> Float
|
|
21
|
+
def scale: () -> Vector2
|
|
22
|
+
def scale=: (Vector2 | Array[Float] value) -> Vector2
|
|
23
|
+
def origin: () -> Vector2
|
|
24
|
+
def origin=: (Vector2 | Array[Float] value) -> Vector2
|
|
25
|
+
def fill_color: () -> Color
|
|
26
|
+
def fill_color=: (Color value) -> Color
|
|
27
|
+
def outline_color: () -> Color
|
|
28
|
+
def outline_color=: (Color value) -> Color
|
|
29
|
+
def outline_thickness: () -> Float
|
|
30
|
+
def outline_thickness=: (Float value) -> Float
|
|
31
|
+
def texture: () -> (Texture | nil)
|
|
32
|
+
def texture=: (Texture? value) -> Texture?
|
|
33
|
+
def texture_rect: () -> Rect
|
|
34
|
+
def texture_rect=: (Rect value) -> Rect
|
|
35
|
+
def geometric_center: () -> Vector2
|
|
36
|
+
def local_bounds: () -> Rect
|
|
37
|
+
def global_bounds: () -> Rect
|
|
38
|
+
def transform: () -> Array[untyped]
|
|
39
|
+
def inverse_transform: () -> Array[untyped]
|
|
40
|
+
def matrix: () -> Array[untyped]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Rect
|
|
3
|
+
include Enumerable[Float]
|
|
4
|
+
|
|
5
|
+
def self.new: () -> Rect
|
|
6
|
+
| (Float left, Float top) -> Rect
|
|
7
|
+
| (Float left, Float top, Float width, Float height) -> Rect
|
|
8
|
+
| (Array[Float] left_top_width_height) -> Rect
|
|
9
|
+
| (Rect other) -> Rect
|
|
10
|
+
|
|
11
|
+
def left: () -> Float
|
|
12
|
+
def left=: (Float value) -> Float
|
|
13
|
+
def top: () -> Float
|
|
14
|
+
def top=: (Float value) -> Float
|
|
15
|
+
def width: () -> Float
|
|
16
|
+
def width=: (Float value) -> Float
|
|
17
|
+
def height: () -> Float
|
|
18
|
+
def height=: (Float value) -> Float
|
|
19
|
+
def position: () -> Vector2
|
|
20
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
21
|
+
def size: () -> Vector2
|
|
22
|
+
def size=: (Vector2 | Array[Float] value) -> Vector2
|
|
23
|
+
def contains?: (Vector2 | Array[Float] point) -> bool
|
|
24
|
+
| (Float x, Float y) -> bool
|
|
25
|
+
def intersects?: (Rect other) -> bool
|
|
26
|
+
def intersection: (Rect other) -> (Rect | nil)
|
|
27
|
+
def to_a: () -> [Float, Float, Float, Float]
|
|
28
|
+
def to_ary: () -> [Float, Float, Float, Float]
|
|
29
|
+
def each: () { (Float) -> void } -> self
|
|
30
|
+
def ==: (untyped other) -> bool
|
|
31
|
+
def to_s: () -> String
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class RectangleShape
|
|
3
|
+
include Drawable
|
|
4
|
+
|
|
5
|
+
def self.new: (?(Vector2 | Array[Float]) size) -> RectangleShape
|
|
6
|
+
|
|
7
|
+
def copy: () -> RectangleShape
|
|
8
|
+
def move: (Vector2 | Array[Float] offset) -> self
|
|
9
|
+
def rotate: (Float angle) -> self
|
|
10
|
+
def scale!: (Vector2 | Array[Float] factors) -> self
|
|
11
|
+
def draw: (untyped target, RenderState state) -> nil
|
|
12
|
+
|
|
13
|
+
def size: () -> Vector2
|
|
14
|
+
def size=: (Vector2 | Array[Float] value) -> Vector2
|
|
15
|
+
def position: () -> Vector2
|
|
16
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
17
|
+
def rotation: () -> Float
|
|
18
|
+
def rotation=: (Float value) -> Float
|
|
19
|
+
def scale: () -> Vector2
|
|
20
|
+
def scale=: (Vector2 | Array[Float] value) -> Vector2
|
|
21
|
+
def origin: () -> Vector2
|
|
22
|
+
def origin=: (Vector2 | Array[Float] value) -> Vector2
|
|
23
|
+
def fill_color: () -> Color
|
|
24
|
+
def fill_color=: (Color value) -> Color
|
|
25
|
+
def outline_color: () -> Color
|
|
26
|
+
def outline_color=: (Color value) -> Color
|
|
27
|
+
def outline_thickness: () -> Float
|
|
28
|
+
def outline_thickness=: (Float value) -> Float
|
|
29
|
+
def texture: () -> (Texture | nil)
|
|
30
|
+
def texture=: (Texture? value) -> Texture?
|
|
31
|
+
def texture_rect: () -> Rect
|
|
32
|
+
def texture_rect=: (Rect value) -> Rect
|
|
33
|
+
def point_count: () -> Integer
|
|
34
|
+
def point: (Integer index) -> Vector2
|
|
35
|
+
def geometric_center: () -> Vector2
|
|
36
|
+
def local_bounds: () -> Rect
|
|
37
|
+
def global_bounds: () -> Rect
|
|
38
|
+
def transform: () -> Array[untyped]
|
|
39
|
+
def inverse_transform: () -> Array[untyped]
|
|
40
|
+
def matrix: () -> Array[untyped]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class RenderState
|
|
3
|
+
def self.new: () -> RenderState
|
|
4
|
+
| (Array[Array[Float]] | Array[Float] matrix) -> RenderState
|
|
5
|
+
|
|
6
|
+
def transform: () -> Array[untyped]
|
|
7
|
+
def transform=: (Array[Array[Float]] | Array[Float] matrix) -> self
|
|
8
|
+
def matrix: () -> Array[untyped]
|
|
9
|
+
def matrix=: (Array[Array[Float]] | Array[Float] matrix) -> self
|
|
10
|
+
def blend_mode: () -> BlendMode
|
|
11
|
+
def blend_mode=: (BlendMode value) -> BlendMode
|
|
12
|
+
def stencil_mode: () -> StencilMode
|
|
13
|
+
def stencil_mode=: (StencilMode value) -> StencilMode
|
|
14
|
+
def coordinate_type: () -> Symbol
|
|
15
|
+
def coordinate_type=: (Symbol value) -> Symbol
|
|
16
|
+
def texture: () -> (Texture | nil)
|
|
17
|
+
def texture=: (Texture? value) -> Texture?
|
|
18
|
+
def shader: () -> (Shader | nil)
|
|
19
|
+
def shader=: (Shader? value) -> Shader?
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class RenderTexture
|
|
3
|
+
def self.new: (Vector2 size, ?untyped settings) -> RenderTexture
|
|
4
|
+
def self.maximum_antialiasing_level: () -> Integer
|
|
5
|
+
|
|
6
|
+
def size: () -> Vector2
|
|
7
|
+
def display: () -> self
|
|
8
|
+
def clear: (?untyped color) -> self
|
|
9
|
+
def view: () -> View
|
|
10
|
+
def default_view: () -> View
|
|
11
|
+
def texture: () -> Texture
|
|
12
|
+
def smooth?: () -> bool
|
|
13
|
+
def repeated?: () -> bool
|
|
14
|
+
def generate_mipmap: () -> bool
|
|
15
|
+
|
|
16
|
+
def view=: (View value) -> self
|
|
17
|
+
def active=: (bool value) -> bool
|
|
18
|
+
def smooth=: (bool value) -> bool
|
|
19
|
+
def repeated=: (bool value) -> bool
|
|
20
|
+
|
|
21
|
+
def draw: (untyped drawable, ?untyped state) -> self
|
|
22
|
+
|
|
23
|
+
# Shared with Window via render_target.inc -- see ext/graphics/render_target.inc
|
|
24
|
+
def srgb?: () -> bool
|
|
25
|
+
def clear_stencil: (Integer value) -> self
|
|
26
|
+
def clear_color_and_stencil: (untyped color, Integer stencil) -> self
|
|
27
|
+
def viewport: (?untyped view) -> untyped
|
|
28
|
+
def scissor: (?untyped view) -> untyped
|
|
29
|
+
def map_pixel_to_coords: (untyped point, ?untyped view) -> untyped
|
|
30
|
+
def map_coords_to_pixel: (untyped point, ?untyped view) -> untyped
|
|
31
|
+
def push_gl_states: () -> self
|
|
32
|
+
def pop_gl_states: () -> self
|
|
33
|
+
def reset_gl_states: () -> self
|
|
34
|
+
def draw_primitives: (untyped vertices, untyped primitive, ?untyped state) -> self
|
|
35
|
+
def draw_vertex_buffer_range: (untyped buffer, Integer first, Integer count, ?untyped state) -> self
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Shader
|
|
3
|
+
def self.from_file: (String vertex, ?String? fragment, ?String? geometry) -> Shader
|
|
4
|
+
def self.from_memory: (String? vertex, ?String? fragment, ?String? geometry) -> Shader
|
|
5
|
+
def self.from_stream: (untyped vertex, ?untyped fragment, ?untyped geometry) -> Shader
|
|
6
|
+
def self.available?: () -> bool
|
|
7
|
+
def self.geometry_available?: () -> bool
|
|
8
|
+
|
|
9
|
+
def native_handle: () -> Integer
|
|
10
|
+
def bind: () -> self
|
|
11
|
+
|
|
12
|
+
def set_float: (String name, Float x) -> self
|
|
13
|
+
def set_int: (String name, Integer x) -> self
|
|
14
|
+
def set_bool: (String name, bool x) -> self
|
|
15
|
+
def set_color: (String name, untyped color) -> self
|
|
16
|
+
def set_int_color: (String name, untyped color) -> self
|
|
17
|
+
def set_vec2: (String name, untyped vector) -> self
|
|
18
|
+
def set_vec3: (String name, untyped vector) -> self
|
|
19
|
+
def set_vec4: (String name, Array[Float] vector) -> self
|
|
20
|
+
def set_ivec2: (String name, untyped vector) -> self
|
|
21
|
+
def set_ivec3: (String name, Array[Integer] vector) -> self
|
|
22
|
+
def set_ivec4: (String name, Array[Integer] vector) -> self
|
|
23
|
+
def set_bvec2: (String name, Array[bool] vector) -> self
|
|
24
|
+
def set_bvec3: (String name, Array[bool] vector) -> self
|
|
25
|
+
def set_bvec4: (String name, Array[bool] vector) -> self
|
|
26
|
+
def set_mat3: (String name, Array[Float] matrix) -> self
|
|
27
|
+
def set_mat4: (String name, Array[Float] matrix) -> self
|
|
28
|
+
def set_float_array: (String name, Array[Float] values) -> self
|
|
29
|
+
def set_vec2_array: (String name, Array[untyped] values) -> self
|
|
30
|
+
def set_vec3_array: (String name, Array[untyped] values) -> self
|
|
31
|
+
def set_vec4_array: (String name, Array[untyped] values) -> self
|
|
32
|
+
def set_mat3_array: (String name, Array[untyped] values) -> self
|
|
33
|
+
def set_mat4_array: (String name, Array[untyped] values) -> self
|
|
34
|
+
def set_texture: (String name, untyped texture) -> untyped
|
|
35
|
+
def set_current_texture: (String name) -> self
|
|
36
|
+
def set_uniform: (String name, untyped value) -> self
|
|
37
|
+
def uniform=: (String name, untyped value) -> self
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Shape
|
|
3
|
+
include Drawable
|
|
4
|
+
|
|
5
|
+
def self.new: () -> Shape
|
|
6
|
+
|
|
7
|
+
def update!: () -> self
|
|
8
|
+
def move: (Vector2 | Array[Float] offset) -> self
|
|
9
|
+
def rotate: (Float angle) -> self
|
|
10
|
+
def scale!: (Vector2 | Array[Float] factors) -> self
|
|
11
|
+
def draw: (untyped target, RenderState state) -> nil
|
|
12
|
+
|
|
13
|
+
def position: () -> Vector2
|
|
14
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
15
|
+
def rotation: () -> Float
|
|
16
|
+
def rotation=: (Float value) -> Float
|
|
17
|
+
def scale: () -> Vector2
|
|
18
|
+
def scale=: (Vector2 | Array[Float] value) -> Vector2
|
|
19
|
+
def origin: () -> Vector2
|
|
20
|
+
def origin=: (Vector2 | Array[Float] value) -> Vector2
|
|
21
|
+
def fill_color: () -> Color
|
|
22
|
+
def fill_color=: (Color value) -> Color
|
|
23
|
+
def outline_color: () -> Color
|
|
24
|
+
def outline_color=: (Color value) -> Color
|
|
25
|
+
def outline_thickness: () -> Float
|
|
26
|
+
def outline_thickness=: (Float value) -> Float
|
|
27
|
+
def texture: () -> (Texture | nil)
|
|
28
|
+
def texture=: (Texture? value) -> Texture?
|
|
29
|
+
def texture_rect: () -> Rect
|
|
30
|
+
def texture_rect=: (Rect value) -> Rect
|
|
31
|
+
def geometric_center: () -> Vector2
|
|
32
|
+
def local_bounds: () -> Rect
|
|
33
|
+
def global_bounds: () -> Rect
|
|
34
|
+
def transform: () -> Array[untyped]
|
|
35
|
+
def inverse_transform: () -> Array[untyped]
|
|
36
|
+
def matrix: () -> Array[untyped]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Sprite
|
|
3
|
+
def self.new: () -> Sprite
|
|
4
|
+
| (Texture texture) -> Sprite
|
|
5
|
+
|
|
6
|
+
def copy: () -> Sprite
|
|
7
|
+
|
|
8
|
+
def texture: () -> (Texture | nil)
|
|
9
|
+
def texture_rect: () -> untyped
|
|
10
|
+
def color: () -> untyped
|
|
11
|
+
def position: () -> Vector2
|
|
12
|
+
def rotation: () -> Float
|
|
13
|
+
def scale: () -> Vector2
|
|
14
|
+
def origin: () -> Vector2
|
|
15
|
+
def transform: () -> Array[Float]
|
|
16
|
+
def inverse_transform: () -> Array[Float]
|
|
17
|
+
def matrix: () -> Array[Float]
|
|
18
|
+
def local_bounds: () -> untyped
|
|
19
|
+
def global_bounds: () -> untyped
|
|
20
|
+
|
|
21
|
+
def texture=: (Texture? value) -> (Texture | nil)
|
|
22
|
+
def texture_rect=: (untyped value) -> untyped
|
|
23
|
+
def color=: (untyped value) -> untyped
|
|
24
|
+
def position=: (Vector2 value) -> Vector2
|
|
25
|
+
def rotation=: (Float value) -> Float
|
|
26
|
+
def scale=: (Vector2 value) -> Vector2
|
|
27
|
+
def origin=: (Vector2 value) -> Vector2
|
|
28
|
+
|
|
29
|
+
def move: (Vector2 offset) -> self
|
|
30
|
+
def rotate: (Float angle) -> self
|
|
31
|
+
def scale!: (Vector2 factors) -> self
|
|
32
|
+
def draw: (untyped target, untyped state) -> nil
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class StencilMode
|
|
3
|
+
def self.new: () -> StencilMode
|
|
4
|
+
| (Symbol | Integer comparison, Symbol | Integer update_operation, Integer reference, Integer mask, bool stencil_only) -> StencilMode
|
|
5
|
+
|
|
6
|
+
def comparison: () -> Symbol
|
|
7
|
+
def comparison=: (Symbol | Integer value) -> (Symbol | Integer)
|
|
8
|
+
def update_operation: () -> Symbol
|
|
9
|
+
def update_operation=: (Symbol | Integer value) -> (Symbol | Integer)
|
|
10
|
+
def reference: () -> Integer
|
|
11
|
+
def reference=: (Integer value) -> Integer
|
|
12
|
+
def mask: () -> Integer
|
|
13
|
+
def mask=: (Integer value) -> Integer
|
|
14
|
+
def stencil_only: () -> bool
|
|
15
|
+
def stencil_only=: (bool value) -> bool
|
|
16
|
+
def ==: (untyped other) -> bool
|
|
17
|
+
end
|
|
18
|
+
end
|