Top Level Namespace

Defined Under Namespace

Modules: MTest Classes: Camera2D, Colour, Font, Image, LocalStorage, Music, Rectangle, RenderTexture, Shader, Sound, Texture2D, Vector2

Constant Summary collapse

FLAG_VSYNC_HINT =

Set to try enabling V-Sync on GPU

0x00000040
FLAG_FULLSCREEN_MODE =

Set to run program in fullscreen

0x00000002
FLAG_WINDOW_RESIZABLE =

Set to allow resizable window

0x00000004
FLAG_WINDOW_UNDECORATED =

Set to disable window decoration (frame and buttons)

0x00000008
FLAG_WINDOW_HIDDEN =

Set to hide window

0x00000080
FLAG_WINDOW_MINIMISED =

Set to minimize window (iconify)

0x00000200
FLAG_WINDOW_MAXIMISED =

Set to maximize window (expanded to monitor)

0x00000400
FLAG_WINDOW_UNFOCUSED =

Set to window non focused

0x00000800
FLAG_WINDOW_TOPMOST =

Set to window always on top

0x00001000
FLAG_WINDOW_ALWAYS_RUN =

Set to allow windows running while minimized

0x00000100
FLAG_WINDOW_TRANSPARENT =

Set to allow transparent framebuffer

0x00000010
FLAG_WINDOW_HIGHDPI =

Set to support HighDPI

0x00002000
FLAG_MSAA_4X_HINT =

Set to try enabling MSAA 4X

0x00000020
FLAG_INTERLACED_HINT =

Set to try enabling interlaced video format (for V3D)

0x00010000
GESTURE_NONE =

When no gesture has happened

0
GESTURE_TAP =

When the tap gesture was triggered

1
GESTURE_DOUBLETAP =

When the doubletap was triggered

2
GESTURE_HOLD =

When the hold was triggered

4
GESTURE_DRAG =

When the drag was triggered

8
GESTURE_SWIPE_RIGHT =

When the swipe_right was triggered

16
GESTURE_SWIPE_LEFT =

When the swipe_left was triggered

32
GESTURE_SWIPE_UP =

When the swipe_up was triggered

64
GESTURE_SWIPE_DOWN =

When the swipe_down was triggered

128
GESTURE_PINCH_IN =

When the pinch_in was triggered

256
GESTURE_PINCH_OUT =

When the pinch_out was triggered

512
LIGHTGRAY =

A nice lightgray colour

Colour.new(200, 200, 200, 255)
GRAY =

A nice gray colour

Colour.new(130, 130, 130, 255)
DARKGRAY =

A nice darkgray colour

Colour.new( 80,  80,  80, 255)
YELLOW =

A nice yellow colour

Colour.new(253, 249,   0, 255)
GOLD =

A nice gold colour

Colour.new(255, 203,   0, 255)
ORANGE =

A nice orange colour

Colour.new(255, 161,   0, 255)
PINK =

A nice pink colour

Colour.new(255, 109, 194, 255)
RED =

A nice red colour

Colour.new(230,  41,  55, 255)
MAROON =

A nice maroon colour

Colour.new(190,  33,  55, 255)
GREEN =

A nice green colour

Colour.new(  0, 228,  48, 255)
LIME =

A nice lime colour

Colour.new(  0, 158,  47, 255)
DARKGREEN =

A nice darkgreen colour

Colour.new(  0, 117,  44, 255)
SKYBLUE =

A nice skyblue colour

Colour.new(102, 191, 255, 255)
BLUE =

A nice blue colour

Colour.new(  0, 121, 241, 255)
DARKBLUE =

A nice darkblue colour

Colour.new(  0,  82, 172, 255)
PURPLE =

A nice purple colour

Colour.new(200, 122, 255, 255)
VIOLET =

A nice violet colour

Colour.new(135,  60, 190, 255)
DARKPURPLE =

A nice darkpurple colour

Colour.new(112,  31, 126, 255)
BEIGE =

A nice beige colour

Colour.new(211, 176, 131, 255)
BROWN =

A nice brown colour

Colour.new(127, 106,  79, 255)
DARKBROWN =

A nice darkbrown colour

Colour.new( 76,  63,  47, 255)
WHITE =

A nice white colour

Colour.new(255, 255, 255, 255)
BLACK =

A nice black colour

Colour.new(  0,   0,   0, 255)
BLANK =

A nice blank colour

Colour.new(  0,   0,   0,   0)
MAGENTA =

A nice magenta colour

Colour.new(255,   0, 255, 255)
RAYWHITE =

The official Raylib white

Colour.new(245, 245, 245, 255)
MOUSE_LEFT_BUTTON =

Left mouse button

0
MOUSE_RIGHT_BUTTON =

Right mouse button

1
MOUSE_MIDDLE_BUTTON =

Middle mouse button (scrollwheel)

2
MOUSE_CURSOR_DEFAULT =

Mouse cursor default

0
MOUSE_CURSOR_ARROW =

Mouse cursor arrow

1
MOUSE_CURSOR_IBEAM =

Mouse cursor ibeam

2
MOUSE_CURSOR_CROSSHAIR =

Mouse cursor crosshair

3
MOUSE_CURSOR_POINTING_HAND =

Mouse cursor pointing_hand

4
MOUSE_CURSOR_RESIZE_EW =

Mouse cursor horizontal resize/move

5
MOUSE_CURSOR_RESIZE_NS =

Mouse cursor vertical resize/move

6
MOUSE_CURSOR_RESIZE_NWSE =

Mouse cursor top-left to bottom-right diagonal resize/move

7
MOUSE_CURSOR_RESIZE_NESW =

Mouse cursor top-right to bottom-left diagonal resize/move

8
MOUSE_CURSOR_RESIZE_ALL =

Mouse cursor omni-directional resize/move

9
MOUSE_CURSOR_NOT_ALLOWED =

Mouse cursor not allowed

10
TEXTURE_FILTER_POINT =

No filter, just pixel approximation

0
TEXTURE_FILTER_BILINEAR =

Linear filtering

1
TEXTURE_FILTER_TRILINEAR =

Trilinear filtering (linear with mipmaps)

2
TEXTURE_FILTER_ANISOTROPIC_4X =

Anisotropic filtering 4x

3
TEXTURE_FILTER_ANISOTROPIC_8X =

Anisotropic filtering 8x

4
TEXTURE_FILTER_ANISOTROPIC_16X =

Anisotropic filtering 16x

5
GAMEPAD_BUTTON_UNKNOWN =

Unknown gamepad button

0
GAMEPAD_BUTTON_LEFT_FACE_UP =

Dpad up

1
GAMEPAD_BUTTON_LEFT_FACE_RIGHT =

Dpad right

2
GAMEPAD_BUTTON_LEFT_FACE_DOWN =

Dpad down

3
GAMEPAD_BUTTON_LEFT_FACE_LEFT =

Dpad left

4
GAMEPAD_BUTTON_RIGHT_FACE_UP =

XBOX: Y PS3: Triangle

5
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT =

PS3: Square

6
GAMEPAD_BUTTON_RIGHT_FACE_DOWN =

PS3: Cross

7
GAMEPAD_BUTTON_RIGHT_FACE_LEFT =

PS3: Circle

8
GAMEPAD_BUTTON_LEFT_TRIGGER_1 =

Left trigger 1

9
GAMEPAD_BUTTON_LEFT_TRIGGER_2 =

Left trigger 2

10
GAMEPAD_BUTTON_RIGHT_TRIGGER_1 =

Right trigger 1

11
GAMEPAD_BUTTON_RIGHT_TRIGGER_2 =

Right trigger 2

12
GAMEPAD_BUTTON_MIDDLE_LEFT =

PS3: Select

13
GAMEPAD_BUTTON_MIDDLE =

Ps Button/XBOX Button

14
GAMEPAD_BUTTON_MIDDLE_RIGHT =

PS3: Start

15
GAMEPAD_BUTTON_LEFT_THUMB =

Left thumbstick pressed

16
GAMEPAD_BUTTON_RIGHT_THUM =

Right thumbstick pressed

17
GAMEPAD_AXIS_LEFT_X =

Left thumbstick axis X

0
GAMEPAD_AXIS_LEFT_Y =

Left thumbstick axis Y

1
GAMEPAD_AXIS_RIGHT_X =

Right thumbstick axis X

2
GAMEPAD_AXIS_RIGHT_Y =

Right thumbstick axis Y

3
GAMEPAD_AXIS_LEFT_TRIGGER =

Pressure level for left trigger [1..-1] (pressure-level)

4
GAMEPAD_AXIS_RIGHT_TRIGGER =

Pressure level for right trigger [1..-1] (pressure-level)

5
KEY_APOSTROPHE =

key apostrophe

39
KEY_COMMA =

key comma

44
KEY_MINUS =

key minus

45
KEY_PERIOD =

key period

46
KEY_SLASH =

key slash

47
KEY_ZERO =

key zero

48
KEY_ONE =

key one

49
KEY_TWO =

key two

50
KEY_THREE =

key three

51
KEY_FOUR =

key four

52
KEY_FIVE =

key five

53
KEY_SIX =

key six

54
KEY_SEVEN =

key seven

55
KEY_EIGHT =

key eight

56
KEY_NINE =

key nine

57
KEY_SEMICOLON =

key semicolon

59
KEY_EQUAL =

key equal

61
KEY_A =

key a

65
KEY_B =

key b

66
KEY_C =

key c

67
KEY_D =

key d

68
KEY_E =

key e

69
KEY_F =

key f

70
KEY_G =

key g

71
KEY_H =

key h

72
KEY_I =

key i

73
KEY_J =

key j

74
KEY_K =

key k

75
KEY_L =

key l

76
KEY_M =

key m

77
KEY_N =

key n

78
KEY_O =

key o

79
KEY_P =

key p

80
KEY_Q =

key q

81
KEY_R =

key r

82
KEY_S =

key s

83
KEY_T =

key t

84
KEY_U =

key u

85
KEY_V =

key v

86
KEY_W =

key w

87
KEY_X =

key x

88
KEY_Y =

key y

89
KEY_Z =

key z

90
KEY_SPACE =

Function keys key space

32
KEY_ESCAPE =

key escape

256
KEY_ENTER =

key enter

257
KEY_TAB =

key tab

258
KEY_BACKSPACE =

key backspace

259
KEY_INSERT =

key insert

260
KEY_DELETE =

key delete

261
KEY_RIGHT =

key right

262
KEY_LEFT =

key left

263
KEY_DOWN =

key down

264
KEY_UP =

key up

265
KEY_PAGE_UP =

key page_up

266
KEY_PAGE_DOWN =

key page_down

267
KEY_HOME =

key home

268
KEY_END =

key end

269
KEY_CAPS_LOCK =

key caps_lock

280
KEY_SCROLL_LOCK =

key scroll_lock

281
KEY_NUM_LOCK =

key num_lock

282
KEY_PRINT_SCREEN =

key print_screen

283
KEY_PAUSE =

key pause

284
KEY_F1 =

key f1

290
KEY_F2 =

key f2

291
KEY_F3 =

key f3

292
KEY_F4 =

key f4

293
KEY_F5 =

key f5

294
KEY_F6 =

key f6

295
KEY_F7 =

key f7

296
KEY_F8 =

key f8

297
KEY_F9 =

key f9

298
KEY_F10 =

key f10

299
KEY_F11 =

key f11

300
KEY_F12 =

key f12

301
KEY_LEFT_SHIFT =

key left_shift

340
KEY_LEFT_CONTROL =

key left_control

341
KEY_LEFT_ALT =

key left_alt

342
KEY_LEFT_SUPER =

key left_super

343
KEY_RIGHT_SHIFT =

key right_shift

344
KEY_RIGHT_CONTROL =

key right_control

345
KEY_RIGHT_ALT =

key right_alt

346
KEY_RIGHT_SUPER =

key right_super

347
KEY_KB_MENU =

key kb_menu

348
KEY_LEFT_BRACKET =

key left_bracket

91
KEY_BACKSLASH =

key backslash

92
KEY_RIGHT_BRACKET =

key right_bracket

93
KEY_GRAVE =

key grave

96
KEY_KP_0 =

Keypad 0

320
KEY_KP_1 =

Keypad 1

321
KEY_KP_2 =

Keypad 2

322
KEY_KP_3 =

Keypad 3

323
KEY_KP_4 =

Keypad 4

324
KEY_KP_5 =

Keypad 5

325
KEY_KP_6 =

Keypad 6

326
KEY_KP_7 =

Keypad 7

327
KEY_KP_8 =

Keypad 8

328
KEY_KP_9 =

Keypad 9

329
KEY_KP_DECIMAL =

Keypad decimal

330
KEY_KP_DIVIDE =

Keypad divide

331
KEY_KP_MULTIPLY =

Keypad multiply

332
KEY_KP_SUBTRACT =

Keypad subtract

333
KEY_KP_ADD =

Keypad add

334
KEY_KP_ENTER =

Keypad enter

335
KEY_KP_EQUAL =

Keypad equal

336
KEY_BACK =

Android back

4
KEY_MENU =

Android menu

82
KEY_VOLUME_UP =

Android volume_up

24
KEY_VOLUME_DOWN =

Android volume_down

25

Instance Method Summary collapse

Instance Method Details

#android?Boolean

Is the current platform Android?

Returns:

  • (Boolean)


3
4
5
6
7
# File 'mrb_doc/platform.rb', line 3

def android?
  # mrb_android
  # src/platform.cpp
  false
end

#audio_device_ready?Boolean

Returns if the audio device has been setup

Returns:

  • (Boolean)


19
20
21
22
23
# File 'mrb_doc/audio/device.rb', line 19

def audio_device_ready?()
  # mrb_audio_device_ready
  # src/mruby_integration/audio/device.cpp
  true
end

#begin_drawingnil

Starts drawing to the screen

Returns:

  • (nil)


12
13
14
15
16
# File 'mrb_doc/core/drawing.rb', line 12

def begin_drawing()
  # mrb_begin_drawing
  # src/mruby_integration/core/drawing.cpp
  nil
end

#begin_mode2D(camera) ⇒ nil

Starts drawing from the perspective of the camera

Parameters:

Returns:

  • (nil)


29
30
31
32
33
# File 'mrb_doc/core/drawing.rb', line 29

def begin_mode2D(camera)
  # mrb_begin_mode2D
  # src/mruby_integration/core/drawing.cpp
  nil
end

#begin_scissor_mode(x, y, width, height) ⇒ nil

In scissor mode only draw calls within the defined area will actually be drawn

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)

Returns:

  • (nil)


83
84
85
86
87
# File 'mrb_doc/core/drawing.rb', line 83

def begin_scissor_mode(x, y, width, height)
  # mrb_begin_scissor_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#begin_shader_mode(shader) ⇒ nil

All draw calls within will be drawn through the Shader

Parameters:

Returns:

  • (nil)


63
64
65
66
67
# File 'mrb_doc/core/drawing.rb', line 63

def begin_shader_mode(shader)
  # mrb_begin_shader_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#begin_texture_mode(texture) ⇒ nil

Starts drawing to the RenderTexture

Parameters:

Returns:

  • (nil)


46
47
48
49
50
# File 'mrb_doc/core/drawing.rb', line 46

def begin_texture_mode(texture)
  # mrb_begin_texture_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#browser?Boolean

Is the current platform a web browser?

Returns:

  • (Boolean)


35
36
37
38
39
# File 'mrb_doc/platform.rb', line 35

def browser?
  # mrb_browser
  # src/platform.cpp
  false
end

#check_collision_point_rec(point, rectangle) ⇒ Boolean

Checks if a Vector2 is inside a Rectangle

Parameters:

Returns:

  • (Boolean)


5
6
7
8
9
# File 'mrb_doc/shapes/collision.rb', line 5

def check_collision_point_rec(point, rectangle)
  # mrb_check_collision_point_rec
  # src/mruby_integration/shapes/collision.cpp
  true
end

#clear(colour: RAYWHITE) ⇒ nil

Clear the screen with the specified colour

Parameters:

  • colour (Colour) (defaults to: RAYWHITE)

Returns:

  • (nil)


4
5
6
# File 'src/ruby/core/drawing.rb', line 4

def clear(colour: RAYWHITE)
  clear_background(colour)
end

#clear_background(colour) ⇒ nil

Clears the screen with the specified colour

Parameters:

Returns:

  • (nil)


4
5
6
7
8
# File 'mrb_doc/core/drawing.rb', line 4

def clear_background(colour)
  # mrb_clear_background
  # src/mruby_integration/core/drawing.cpp
  nil
end

#clear_window_state(flags) ⇒ nil

Clears the specified states on the window, to pass in multiple you can do so like: clear_window_state(FLAG_WINDOW_ALWAYS_RUN | FLAG_WINDOW_HIDDEN)

Parameters:

  • flags (Integer)

Returns:

  • (nil)


108
109
110
111
112
# File 'mrb_doc/core/window.rb', line 108

def clear_window_state(flags)
  # mrb_clear_window_state
  # src/mruby_integration/core/window.cpp
  nil
end

#close_audio_devicenil

Closes the audio device

Returns:

  • (nil)


11
12
13
14
15
# File 'mrb_doc/audio/device.rb', line 11

def close_audio_device()
  # mrb_close_audio_device
  # src/mruby_integration/audio/device.cpp
  nil
end

#close_windownil

Close the open window

Returns:

  • (nil)


22
23
24
25
26
# File 'mrb_doc/core/window.rb', line 22

def close_window()
  # mrb_close_window
  # src/mruby_integration/core/window.cpp
  nil
end

#cursor_hidden?Boolean

Checks if the cursor is hidden

Returns:

  • (Boolean)


19
20
21
22
23
# File 'mrb_doc/core/cursor.rb', line 19

def cursor_hidden?()
  # mrb_cursor_hidden
  # src/mruby_integration/core/cursor.cpp
  true
end

#cursor_on_screen?Boolean

Checks if the cursor is in the window

Returns:

  • (Boolean)


43
44
45
46
47
# File 'mrb_doc/core/cursor.rb', line 43

def cursor_on_screen?
  # mrb_cursor_on_screen
  # src/mruby_integration/core/cursor.cpp
  true
end

#disable_cursornil

Disables the cursor and hides it

Returns:

  • (nil)


35
36
37
38
39
# File 'mrb_doc/core/cursor.rb', line 35

def disable_cursor
  # mrb_disable_cursor
  # src/mruby_integration/core/cursor.cpp
  nil
end

#draw_circle(x, y, radius, colour) ⇒ nil

Draw a circle

Parameters:

  • x (Integer)
  • y (Integer)
  • radius (Float)
  • colour (Colour)

Returns:

  • (nil)


7
8
9
10
11
# File 'mrb_doc/shapes/circle.rb', line 7

def draw_circle(x, y, radius, colour)
  # mrb_draw_circle
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_circle_gradient(x, y, radius, colour1, colour2) ⇒ nil

Draw a circle filled with a gradient

Parameters:

  • x (Integer)
  • y (Integer)
  • radius (Float)
  • colour1 (Colour)
  • colour2 (Colour)

Returns:

  • (nil)


59
60
61
62
63
# File 'mrb_doc/shapes/circle.rb', line 59

def draw_circle_gradient(x, y, radius, colour1, colour2)
  # mrb_draw_circle_gradient
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_circle_lines(x, y, radius, colour) ⇒ nil

Draw the outline of a circle

Parameters:

  • x (Integer)
  • y (Integer)
  • radius (Float)
  • colour (Colour)

Returns:

  • (nil)


71
72
73
74
75
# File 'mrb_doc/shapes/circle.rb', line 71

def draw_circle_lines(x, y, radius, colour)
  # mrb_draw_circle_lines
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_circle_sector(vector, radius, start_angle, end_angle, segments, colour) ⇒ nil

Draw a circle sector

Parameters:

  • vector (Vector2)
  • radius (Float)
  • start_angle (Float)
  • end_angle (Float)
  • segments (Integer)

    How smooth to draw the sector

  • colour (Colour)

Returns:

  • (nil)


32
33
34
35
36
# File 'mrb_doc/shapes/circle.rb', line 32

def draw_circle_sector(vector, radius, start_angle, end_angle, segments, colour)
  # mrb_draw_circle_sector
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_circle_sector_lines(vector, radius, start_angle, end_angle, segments, colour) ⇒ nil

Draw a circle sector outline

Parameters:

  • vector (Vector2)
  • radius (Float)
  • start_angle (Float)
  • end_angle (Float)
  • segments (Integer)

    How smooth to draw the sector

  • colour (Colour)

Returns:

  • (nil)


46
47
48
49
50
# File 'mrb_doc/shapes/circle.rb', line 46

def draw_circle_sector_lines(vector, radius, start_angle, end_angle, segments, colour)
  # mrb_draw_circle_sector_lines
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_circle_v(vector, radius, colour) ⇒ nil

Draw a circle

Parameters:

Returns:

  • (nil)


18
19
20
21
22
# File 'mrb_doc/shapes/circle.rb', line 18

def draw_circle_v(vector, radius, colour)
  # mrb_draw_circle_v
  # src/mruby_integration/shapes/circle.cpp
  nil
end

#draw_ellipse(x, y, radius_h, radius_v, colour) ⇒ nil

Draw an ellipse

Parameters:

  • x (Integer)
  • y (Integer)
  • radius_h (Float)

    The horizontal radius

  • radius_v (Float)

    The vertical radius

  • colour (Colour)

Returns:

  • (nil)


8
9
10
11
12
# File 'mrb_doc/shapes/ellipse.rb', line 8

def draw_ellipse(x, y, radius_h, radius_v, colour)
  # mrb_draw_ellipse
  # src/mruby_integration/shapes/ellipse.cpp
  nil
end

#draw_ellipse_lines(x, y, radius_h, radius_v, colour) ⇒ nil

Draw the outline of an ellipse

Parameters:

  • x (Integer)
  • y (Integer)
  • radius_h (Float)

    The horizontal radius

  • radius_v (Float)

    The vertical radius

  • colour (Colour)

Returns:

  • (nil)


21
22
23
24
25
# File 'mrb_doc/shapes/ellipse.rb', line 21

def draw_ellipse_lines(x, y, radius_h, radius_v, colour)
  # mrb_draw_ellipse_lines
  # src/mruby_integration/shapes/ellipse.cpp
  nil
end

#draw_fps(x, y) ⇒ nil

Draws the current frame rate at the passed in x and y coordinates.

Parameters:

  • x (Integer)
  • y (Integer)

Returns:

  • (nil)


34
35
36
37
38
# File 'mrb_doc/text.rb', line 34

def draw_fps(x, y)
  # mrb_draw_fps
  # src/mruby_integration/text.cpp
  nil
end

#draw_line(start_x, start_y, end_x, end_y, colour) ⇒ nil

Draw a line between the start and end points

Parameters:

  • start_x (Integer)
  • start_y (Integer)
  • end_x (Integer)
  • end_y (Integer)
  • colour (Colour)

Returns:

  • (nil)


8
9
10
11
12
# File 'mrb_doc/shapes/line.rb', line 8

def draw_line(start_x, start_y, end_x, end_y, colour)
  # mrb_draw_line
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_line_bezier(start, stop, thickness, colour) ⇒ nil

Draw a bezier curve between the start and end points using Vector2s and specified thickness

Parameters:

Returns:

  • (nil)


43
44
45
46
47
# File 'mrb_doc/shapes/line.rb', line 43

def draw_line_bezier(start, stop, thickness, colour)
  # mrb_draw_line_bezier
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_line_bezier_quad(start, stop, control, thickness, colour) ⇒ nil

Draw a bezier curve between the start and end points passing through the control using Vector2s and specified thickness

Parameters:

Returns:

  • (nil)


56
57
58
59
60
# File 'mrb_doc/shapes/line.rb', line 56

def draw_line_bezier_quad(start, stop, control, thickness, colour)
  # mrb_draw_line_bezier_quad
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_line_ex(start, stop, thickness, colour) ⇒ nil

Draw a line between the start and end points using Vector2s and specified thickness

Parameters:

Returns:

  • (nil)


31
32
33
34
35
# File 'mrb_doc/shapes/line.rb', line 31

def draw_line_ex(start, stop, thickness, colour)
  # mrb_draw_line_ex
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_line_strip(vectors, colour) ⇒ nil

I honestly don’t know how this method is supposed to work, I thought I had bugs in my code but reproducing it in plain C++ causes it to do the same things. As far as I can tell it just draws a line from 0, 0 to the first vector and nothing else.

Parameters:

Returns:

  • (nil)


69
70
71
72
73
# File 'mrb_doc/shapes/line.rb', line 69

def draw_line_strip(vectors, colour)
  # mrb_draw_line_strips
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_line_v(start, stop, colour) ⇒ nil

Draw a line between the start and end points using Vector2s

Parameters:

Returns:

  • (nil)


19
20
21
22
23
# File 'mrb_doc/shapes/line.rb', line 19

def draw_line_v(start, stop, colour)
  # mrb_draw_line_v
  # src/mruby_integration/shapes/line.cpp
  nil
end

#draw_pixel(x, y, colour) ⇒ nil

Draw a pixel

Parameters:

  • x (Integer)
  • y (Integer)
  • colour (Colour)

Returns:

  • (nil)


6
7
8
9
10
# File 'mrb_doc/shapes/pixel.rb', line 6

def draw_pixel(x, y, colour)
  # mrb_draw_pixel
  # src/mruby_integration/shapes/pixel.cpp
  nil
end

#draw_pixel_v(position, colour) ⇒ nil

Draw a pixel using a Vector2

Parameters:

Returns:

  • (nil)


16
17
18
19
20
# File 'mrb_doc/shapes/pixel.rb', line 16

def draw_pixel_v(position, colour)
  # mrb_draw_pixel_v
  # src/mruby_integration/shapes/pixel.cpp
  nil
end

#draw_rectangle(x, y, width, height, colour) ⇒ nil

Draw a rectangle

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)
  • colour (Colour)

Returns:

  • (nil)


8
9
10
11
12
# File 'mrb_doc/shapes/rectangle.rb', line 8

def draw_rectangle(x, y, width, height, colour)
  # mrb_draw_rectangle
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_gradient_ex(rectangle, colour1, colour2, colour3, colour4) ⇒ nil

Draw a rectangle with a gradient from each vertex

Parameters:

Returns:

  • (nil)


71
72
73
74
75
# File 'mrb_doc/shapes/rectangle.rb', line 71

def draw_rectangle_gradient_ex(rectangle, colour1, colour2, colour3, colour4)
  # mrb_draw_rectangle_gradient_ex
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_gradient_h(x, y, width, height, colour1, colour2) ⇒ nil

Draw a rectangle with a gradient horizontally

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)
  • colour1 (Colour)
  • colour2 (Colour)

Returns:

  • (nil)


58
59
60
61
62
# File 'mrb_doc/shapes/rectangle.rb', line 58

def draw_rectangle_gradient_h(x, y, width, height, colour1, colour2)
  # mrb_draw_rectangle_gradient_h
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_gradient_v(x, y, width, height, colour1, colour2) ⇒ nil

Draw a rectangle with a gradient vertically

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)
  • colour1 (Colour)
  • colour2 (Colour)

Returns:

  • (nil)


44
45
46
47
48
# File 'mrb_doc/shapes/rectangle.rb', line 44

def draw_rectangle_gradient_v(x, y, width, height, colour1, colour2)
  # mrb_draw_rectangle_gradient_v
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_lines(x, y, width, height, colour) ⇒ nil

Draw a rectangle outline

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)
  • colour (Colour)

Returns:

  • (nil)


84
85
86
87
88
# File 'mrb_doc/shapes/rectangle.rb', line 84

def draw_rectangle_lines(x, y, width, height, colour)
  # mrb_draw_rectangle_lines
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_lines_ex(rectangle, thickness, colour) ⇒ nil

Draw a rectangle outline with the specific thickness

Parameters:

Returns:

  • (nil)


95
96
97
98
99
# File 'mrb_doc/shapes/rectangle.rb', line 95

def draw_rectangle_lines_ex(rectangle, thickness, colour)
  # mrb_draw_rectangle_lines_ex
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_pro(rectangle, origin, rotation, colour) ⇒ nil

Draw a rectangle with rotation

Parameters:

Returns:

  • (nil)


30
31
32
33
34
# File 'mrb_doc/shapes/rectangle.rb', line 30

def draw_rectangle_pro(rectangle, origin, rotation, colour)
  # mrb_draw_rectangle_pro
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_rec(rectangle, colour) ⇒ nil

Draw a rectangle

Parameters:

Returns:

  • (nil)


18
19
20
21
22
# File 'mrb_doc/shapes/rectangle.rb', line 18

def draw_rectangle_rec(rectangle, colour)
  # mrb_draw_rectangle_rec
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_rounded(rectangle, radius, segments, colour) ⇒ nil

Draw a rectangle with rounded corners

Parameters:

  • rectangle (Rectangle)
  • radius (Float)

    A value between 0.0 and 1.0

  • segments (Integer)

    How smooth to draw the corners

  • colour (Colour)

Returns:

  • (nil)


107
108
109
110
111
# File 'mrb_doc/shapes/rectangle.rb', line 107

def draw_rectangle_rounded(rectangle, radius, segments, colour)
  # mrb_draw_rectangle_rounded
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_rectangle_rounded_lines(rectangle, radius, segments, thickness, colour) ⇒ nil

Draw the outline of a rectangle with rounded corners

Parameters:

  • rectangle (Rectangle)
  • radius (Float)

    A value between 0.0 and 1.0

  • segments (Integer)

    How smooth to draw the corners

  • thickness (Integer)
  • colour (Colour)

Returns:

  • (nil)


120
121
122
123
124
# File 'mrb_doc/shapes/rectangle.rb', line 120

def draw_rectangle_rounded_lines(rectangle, radius, segments, thickness, colour)
  # mrb_draw_rectangle_rounded_lines
  # src/mruby_integration/shapes/rectangle.cpp
  nil
end

#draw_ring(vector, inner_radius, outer_radius, start_angle, end_angle, segments, colour) ⇒ nil

Draw a ring

Parameters:

  • vector (Vector)
  • inner_radius (Float)
  • outer_radius (Float)
  • start_angle (Float)
  • end_angle (Float)
  • segments (Integer)

    How smooth to draw the sector

  • colour (Colour)

Returns:

  • (nil)


10
11
12
13
14
# File 'mrb_doc/shapes/ring.rb', line 10

def draw_ring(vector, inner_radius, outer_radius, start_angle, end_angle, segments, colour)
  # mrb_draw_ring
  # src/mruby_integration/shapes/ring.cpp
  nil
end

#draw_ring_lines(vector, inner_radius, outer_radius, start_angle, end_angle, segments, colour) ⇒ nil

Draw the outline of a ring

Parameters:

  • vector (Vector)
  • inner_radius (Float)
  • outer_radius (Float)
  • start_angle (Float)
  • end_angle (Float)
  • segments (Integer)

    How smooth to draw the sector

  • colour (Colour)

Returns:

  • (nil)


25
26
27
28
29
# File 'mrb_doc/shapes/ring.rb', line 25

def draw_ring_lines(vector, inner_radius, outer_radius, start_angle, end_angle, segments, colour)
  # mrb_draw_ring_lines
  # src/mruby_integration/shapes/ring.cpp
  nil
end

#draw_text(text, x, y, font_size, colour) ⇒ nil

Draws the current frame rate at the passed in x and y coordinates.

Parameters:

  • text (String)

    The text to put on the screen

  • x (Integer)
  • y (Integer)
  • font_size (Integer)
  • colour (Colour)

Returns:

  • (nil)


47
48
49
50
51
# File 'mrb_doc/text.rb', line 47

def draw_text(text, x, y, font_size, colour)
  # mrb_draw_text
  # src/mruby_integration/text.cpp
  nil
end

#draw_text_ex(font, text, position, font_size, font_padding, colour) ⇒ nil

Draws the text at the given position, size, padding, and colour with the specified font

Parameters:

  • font (Font)

    Which font to draw with

  • text (String)

    The text to put on the screen

  • position (Vector2)
  • font_size (Integer)
  • font_padding (Integer)
  • colour (Colour)

Returns:

  • (nil)


61
62
63
64
65
# File 'mrb_doc/text.rb', line 61

def draw_text_ex(font, text, position, font_size, font_padding, colour)
  # mrb_draw_text_ex
  # src/mruby_integration/text.cpp
  nil
end

#draw_texture(texture, x, y, colour) ⇒ nil

Draws a texture, the colour will apply a tint and alpha levels

Parameters:

Returns:

  • (nil)


34
35
36
37
38
# File 'mrb_doc/textures.rb', line 34

def draw_texture(texture, x, y, colour)
  # mrb_draw_texture
  # src/mruby_integration/textures.cpp
  nil
end

#draw_texture_pro(texture, source, destination, origin, rotation, colour) ⇒ nil

Draws a section of texture with the specified rotation to the scaled to the destination rectangle, the colour will apply a tint and alpha levels

Parameters:

Returns:

  • (nil)


49
50
51
52
53
# File 'mrb_doc/textures.rb', line 49

def draw_texture_pro(texture, source, destination, origin, rotation, colour)
  # mrb_draw_texture_pro
  # src/mruby_integration/textures.cpp
  nil
end

#draw_triangle(left, right, top, colour) ⇒ nil

Draw a triangle

Parameters:

Returns:

  • (nil)


7
8
9
10
11
# File 'mrb_doc/shapes/triangle.rb', line 7

def draw_triangle(left, right, top, colour)
  # mrb_draw_triangle
  # src/mruby_integration/shapes/triangle.cpp
  nil
end

#draw_triangle_lines(left, right, top, colour) ⇒ nil

Draw the outline of a triangle

Parameters:

Returns:

  • (nil)


19
20
21
22
23
# File 'mrb_doc/shapes/triangle.rb', line 19

def draw_triangle_lines(left, right, top, colour)
  # mrb_draw_triangle_lines
  # src/mruby_integration/shapes/triangle.cpp
  nil
end

#drawing { ... } ⇒ nil

Allows you to call rendering functions within the block

Yields:

  • The block that calls your rendering logic

Returns:

  • (nil)


11
12
13
14
15
16
# File 'src/ruby/core/drawing.rb', line 11

def drawing(&block)
  begin_drawing
  block.call
ensure
  end_drawing
end

#enable_cursornil

Enables and shows the cursor

Returns:

  • (nil)


27
28
29
30
31
# File 'mrb_doc/core/cursor.rb', line 27

def enable_cursor
  # mrb_enable_cursor
  # src/mruby_integration/core/cursor.cpp
  nil
end

#end_drawingnil

Ends drawing to the screen

Returns:

  • (nil)


20
21
22
23
24
# File 'mrb_doc/core/drawing.rb', line 20

def end_drawing()
  # mrb_end_drawing
  # src/mruby_integration/core/drawing.cpp
  nil
end

#end_mode2Dnil

Stops drawing from the perspective of the camera

Returns:

  • (nil)


37
38
39
40
41
# File 'mrb_doc/core/drawing.rb', line 37

def end_mode2D()
  # mrb_end_mode2D
  # src/mruby_integration/core/drawing.cpp
  nil
end

#end_scissor_modenil

End scissor mode

Returns:

  • (nil)


91
92
93
94
95
# File 'mrb_doc/core/drawing.rb', line 91

def end_scissor_mode()
  # mrb_end_scissor_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#end_shader_modenil

Stops drawing through the Shader

Returns:

  • (nil)


71
72
73
74
75
# File 'mrb_doc/core/drawing.rb', line 71

def end_shader_mode()
  # mrb_end_shader_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#end_texture_modenil

Stops drawing to the RenderTexture

Returns:

  • (nil)


54
55
56
57
58
# File 'mrb_doc/core/drawing.rb', line 54

def end_texture_mode()
  # mrb_end_texture_mode
  # src/mruby_integration/core/drawing.cpp
  nil
end

#export_image(image, path) ⇒ nil

Exports an image to a file

Parameters:

  • image (Image)
  • path (String)

Returns:

  • (nil)


23
24
25
26
27
# File 'mrb_doc/image.rb', line 23

def export_image(image, path)
  # mrb_export_image
  # src/mruby_integration/image.cpp
  nil
end

#fade(colour) ⇒ Colour

Returns a new colour which is a faded version of the original

Parameters:

  • colour (Colour)

    olour [Colour

Returns:



58
59
60
61
62
# File 'mrb_doc/textures.rb', line 58

def fade(colour)
  # mrb_fade
  # src/mruby_integration/textures.cpp
  Colour.new
end

#files_dropped?nil

Have their been files dropped that haven’t been dealt with?

Returns:

  • (nil)


3
4
5
6
7
# File 'mrb_doc/core/files.rb', line 3

def files_dropped?()
  # mrb_files_dropped
  # src/mruby_integration/core/files.cpp
  true
end

#gamepad_available?(index) ⇒ Bool

Return whether or not the specified gamepad is available

Parameters:

  • index (Integer)

Returns:

  • (Bool)


4
5
6
7
8
# File 'mrb_doc/core/input/gamepad.rb', line 4

def gamepad_available?(index)
  # mrb_gamepad_available
  # src/mruby_integration/core/input/gamepad.cpp
  true
end

#gamepad_button_down?(index, button) ⇒ Boolean

Is the specified button down on the specific gamepad?

Parameters:

  • index (Integer)
  • button (Integer)

Returns:

  • (Boolean)


33
34
35
36
37
# File 'mrb_doc/core/input/gamepad.rb', line 33

def gamepad_button_down?(index, button)
  # mrb_gamepad_button_down
  # src/mruby_integration/core/input/gamepad.cpp
  true
end

#gamepad_button_pressed?(index, button) ⇒ Boolean

Has the specified button been pressed on the specific gamepad?

Parameters:

  • index (Integer)
  • button (Integer)

Returns:

  • (Boolean)


23
24
25
26
27
# File 'mrb_doc/core/input/gamepad.rb', line 23

def gamepad_button_pressed?(index, button)
  # mrb_gamepad_button_pressed
  # src/mruby_integration/core/input/gamepad.cpp
  true
end

#gamepad_button_released?(index, button) ⇒ Boolean

Has the specified button been released on the specific gamepad?

Parameters:

  • index (Integer)
  • button (Integer)

Returns:

  • (Boolean)


43
44
45
46
47
# File 'mrb_doc/core/input/gamepad.rb', line 43

def gamepad_button_released?(index, button)
  # mrb_gamepad_button_released
  # src/mruby_integration/core/input/gamepad.cpp
  false
end

#gamepad_button_up?(index, button) ⇒ Boolean

Is the specified button not being pressed on the specific gamepad?

Parameters:

  • index (Integer)
  • button (Integer)

Returns:

  • (Boolean)


53
54
55
56
57
# File 'mrb_doc/core/input/gamepad.rb', line 53

def gamepad_button_up?(index, button)
  # mrb_gamepad_button_up
  # src/mruby_integration/core/input/gamepad.cpp
  true
end

#generate_image_colour(width, height, colour) ⇒ Image

Generates a new image of width by height in the specified colour.

Parameters:

  • width (Integer)
  • height (Integer)
  • colour (Colour)

Returns:



34
35
36
37
38
# File 'mrb_doc/image.rb', line 34

def generate_image_colour(width, height, colour)
  # mrb_generate_image_colour
  # src/mruby_integration/image.cpp
  Image.new
end

#generate_texture_mipmaps(texture) ⇒ nil

Generates mipmaps for the Texture2D

Parameters:

Returns:

  • (nil)


67
68
69
70
71
# File 'mrb_doc/textures.rb', line 67

def generate_texture_mipmaps(texture)
  # mrb_gen_texture_mipmaps
  # src/mruby_integration/textures.cpp
  nil
end

#get_attribute_from_element(selector, attribute) ⇒ String

Gets the attribute from the specified element. If it’s a data attribute you can just pass ‘data-blah’

Parameters:

  • selector (String)
  • attribute (String)

Returns:

  • (String)

Raises:

  • (PlatformSpecificMethodCalledOnWrongPlatformError)

    If run on non-web platforms



7
8
9
# File 'src/ruby/platform_specific/web.rb', line 7

def get_attribute_from_element(selector, attribute)
    raise PlatformSpecificMethodCalledOnWrongPlatformError, 'get_attribute_from_element is only available for Web exports'
end

#get_char_pressedInteger

Returns the charcode for the pressed key, call it multiple times for queued keys

Returns:

  • (Integer)


56
57
58
59
60
# File 'mrb_doc/core/input/keyboard.rb', line 56

def get_char_pressed
  # mrb_getchar_pressed
  # src/mruby_integration/core/input/keyboard.cpp
  64
end

#get_clipboard_textString

Gets the clipboard value

Returns:

  • (String)


52
53
54
55
56
# File 'mrb_doc/core/misc.rb', line 52

def get_clipboard_text()
  # mrb_get_clipboard_text
  # src/mruby_integration/core/misc.cpp
  'Clipboard Text'
end

#get_current_monitorInteger

Gets the id of the current monitor

Returns:

  • (Integer)


230
231
232
233
234
# File 'mrb_doc/core/window.rb', line 230

def get_current_monitor()
  # mrb_get_current_monitor
  # src/mruby_integration/core/window.cpp
  0
end

#get_dropped_filesArray<String>

Return an array of the files that were last dropped on the window, will return an empty array if no files have been dropped since the program started or this method was last called.

Returns:

  • (Array<String>)


13
14
15
16
17
18
19
20
21
# File 'mrb_doc/core/files.rb', line 13

def get_dropped_files()
  # mrb_get_dropped_files
  # src/mruby_integration/core/files.cpp
  [
    '/home/taylor/Gemfile',
    '/home/taylor/src/main.cpp',
    '/home/taylor/README.md',
  ]
end

#get_fpsInteger

Returns the current framerate as an integer

Returns:

  • (Integer)


12
13
14
15
16
# File 'mrb_doc/core/timing.rb', line 12

def get_fps()
  # mrb_get_fps
  # src/mruby_integration/core/timing.cpp
  60
end

#get_frame_timeFloat

Returns the amount of time the last frame took in seconds

Returns:

  • (Float)


20
21
22
23
24
# File 'mrb_doc/core/timing.rb', line 20

def get_frame_time()
  # mrb_frame_time
  # src/mruby_integration/core/timing.cpp
  0.01633
end

#get_gamepad_axis_count(index) ⇒ Integer

Returns the count of axis for the specified gamepad

Parameters:

  • index (Integer)

Returns:

  • (Integer)


70
71
72
73
74
# File 'mrb_doc/core/input/gamepad.rb', line 70

def get_gamepad_axis_count(index)
  # mrb_get_gamepad_axis_count
  # src/mruby_integration/core/input/gamepad.cpp
  2
end

#get_gamepad_axis_movement(index, axis) ⇒ Float

Returns the movement of the specified axis for the specified gamepad

Parameters:

  • index (Integer)
  • axis (Integer)

Returns:

  • (Float)

    -1.0 to 1.0



80
81
82
83
84
# File 'mrb_doc/core/input/gamepad.rb', line 80

def get_gamepad_axis_movement(index, axis)
  # mrb_get_gamepad_axis_movement
  # src/mruby_integration/core/input/gamepad.cpp
  0.5
end

#get_gamepad_button_pressedInteger

Returns the last pressed gamepad button

Returns:

  • (Integer)


61
62
63
64
65
# File 'mrb_doc/core/input/gamepad.rb', line 61

def get_gamepad_button_pressed()
  # mrb_get_gamepad_button_pressed
  # src/mruby_integration/core/input/gamepad.cpp
  0
end

#get_gamepad_name(index) ⇒ String

Returns the specified gamepads name

Parameters:

  • index (Integer)

Returns:

  • (String)


13
14
15
16
17
# File 'mrb_doc/core/input/gamepad.rb', line 13

def get_gamepad_name(index)
  # mrb_get_gamepad_name
  # src/mruby_integration/core/input/gamepad.cpp
  'Xbox Controller'
end

#get_gesture_detectedInteger

Returns the detected gestures based on their constant

Returns:

  • (Integer)


13
14
15
16
17
# File 'mrb_doc/core/gestures.rb', line 13

def get_gesture_detected()
  # mrb_get_gesture_detected
  # src/mruby_integration/core/gestures.cpp
  GESTURE_TAP
end

#get_key_pressedInteger

Returns the keycode for the pressed key, call it multiple times for queued keys

Returns:

  • (Integer)


48
49
50
51
52
# File 'mrb_doc/core/input/keyboard.rb', line 48

def get_key_pressed
  # mrb_get_key_pressed
  # src/mruby_integration/core/input/keyboard.cpp
  64
end

#get_monitor_countInteger

Gets the total number of monitors the user has

Returns:

  • (Integer)


222
223
224
225
226
# File 'mrb_doc/core/window.rb', line 222

def get_monitor_count()
  # mrb_get_monitor_count
  # src/mruby_integration/core/window.cpp
  2
end

#get_monitor_height(monitor) ⇒ Integer

Gets the height of the specified monitor

Parameters:

  • monitor (Integer)

Returns:

  • (Integer)


257
258
259
260
261
# File 'mrb_doc/core/window.rb', line 257

def get_monitor_height(monitor)
  # mrb_get_monitor_height
  # src/mruby_integration/core/window.cpp
  1080
end

#get_monitor_position(monitor) ⇒ Vector2

Gets the position of the specified monitor

Parameters:

  • monitor (Integer)

Returns:



239
240
241
242
243
# File 'mrb_doc/core/window.rb', line 239

def get_monitor_position(monitor)
  # mrb_get_monitor_position
  # src/mruby_integration/core/window.cpp
  Vector2.new(0, 0,)
end

#get_monitor_refresh_rate(monitor) ⇒ Integer

Gets the refresh rate of the specified monitor

Parameters:

  • monitor (Integer)

Returns:

  • (Integer)


266
267
268
269
270
# File 'mrb_doc/core/window.rb', line 266

def get_monitor_refresh_rate(monitor)
  # mrb_get_monitor_refresh_rate
  # src/mruby_integration/core/window.cpp
  60
end

#get_monitor_width(monitor) ⇒ Integer

Gets the width of the specified monitor

Parameters:

  • monitor (Integer)

Returns:

  • (Integer)


248
249
250
251
252
# File 'mrb_doc/core/window.rb', line 248

def get_monitor_width(monitor)
  # mrb_get_monitor_width
  # src/mruby_integration/core/window.cpp
  1920
end

#get_mouse_positionVector2

Returns the current mouse position in the window

Returns:



55
56
57
58
59
# File 'mrb_doc/core/input/mouse.rb', line 55

def get_mouse_position()
  # mrb_get_mouse_position
  # src/mruby_integration/core/input/mouse.cpp
  Vector2.new
end

#get_mouse_wheel_moveFloat

Returns the movement of the mouse wheel since last frame

Returns:

  • (Float)


93
94
95
96
97
# File 'mrb_doc/core/input/mouse.rb', line 93

def get_mouse_wheel_move()
  # mrb_get_mouse_wheel_move
  # src/mruby_integration/core/input/mouse.cpp
  0.5
end

#get_mouse_xInteger

Returns the current mouse x position in the window

Returns:

  • (Integer)


39
40
41
42
43
# File 'mrb_doc/core/input/mouse.rb', line 39

def get_mouse_x()
  # mrb_get_mouse_x
  # src/mruby_integration/core/input/mouse.cpp
  64
end

#get_mouse_yInteger

Returns the current mouse y position in the window

Returns:

  • (Integer)


47
48
49
50
51
# File 'mrb_doc/core/input/mouse.rb', line 47

def get_mouse_y()
  # mrb_get_mouse_y
  # src/mruby_integration/core/input/mouse.cpp
  64
end

#get_music_time_length(music) ⇒ Float

Gets the length of a music object in seconds

Parameters:

Returns:

  • (Float)

    The length of the music object is seconds



96
97
98
99
100
# File 'mrb_doc/audio/music.rb', line 96

def get_music_time_length(music)
  # mrb_get_music_time_length
  # src/mruby_integration/audio/music.cpp
  nil
end

#get_music_time_played(music) ⇒ Float

Gets the time played of a music object in seconds

Parameters:

Returns:

  • (Float)

    The length of the music object is seconds



105
106
107
108
109
# File 'mrb_doc/audio/music.rb', line 105

def get_music_time_played(music)
  # mrb_get_music_time_played
  # src/mruby_integration/audio/music.cpp
  nil
end

#get_screen_dataImage

Returns an Image object with the screen data

Returns:



245
246
247
248
249
# File 'mrb_doc/image.rb', line 245

def get_screen_data()
  # mrb_get_screen_data
  # src/mruby_integration/image.cpp
  Image.new
end

#get_screen_heightInteger

Gets the height of the window

Returns:

  • (Integer)


214
215
216
217
218
# File 'mrb_doc/core/window.rb', line 214

def get_screen_height()
  # mrb_get_screen_height
  # src/mruby_integration/core/window.cpp
  480
end

#get_screen_to_world2D(vector, camera) ⇒ Vector2

Translates the vector to where it is in the world based on it the camera

Parameters:

Returns:



15
16
17
18
19
# File 'mrb_doc/core/screen_space.rb', line 15

def get_screen_to_world2D(vector, camera)
  # mrb_get_screen_to_world2D
  # src/mruby_integration/core/screen_space.cpp
  Vector2.new
end

#get_screen_widthInteger

Gets the width of the window

Returns:

  • (Integer)


206
207
208
209
210
# File 'mrb_doc/core/window.rb', line 206

def get_screen_width()
  # mrb_get_screen_width
  # src/mruby_integration/core/window.cpp
  640
end

#get_shader_location(shader, variable) ⇒ Integer

Returns the location of uniform variable, will return -1 if not found.

Parameters:

  • shader (Shader)
  • variable (String)

Returns:

  • (Integer)


43
44
45
46
47
# File 'mrb_doc/shaders.rb', line 43

def get_shader_location(shader, variable)
  # mrb_get_shader_location
  # src/mruby_integration/shaders.cpp
  1
end

#get_timeFloat

Returns the amount of time the has passed since init_window was called

Returns:

  • (Float)


28
29
30
31
32
# File 'mrb_doc/core/timing.rb', line 28

def get_time()
  # mrb_time
  # src/mruby_integration/core/timing.cpp
  36.345
end

#get_touch_position(index) ⇒ Vector2

Get the position within the window of the specified touch

Parameters:

  • index (Integer)

Returns:



4
5
6
7
8
# File 'mrb_doc/core/input/touch.rb', line 4

def get_touch_position(index)
  # mrb_get_touch_position
  # src/mruby_integration/core/input/touch.cpp
  Vector2.new
end

#get_window_positionVector2

Gets the position of the window

Returns:



274
275
276
277
278
# File 'mrb_doc/core/window.rb', line 274

def get_window_position()
  # mrb_get_window_position
  # src/mruby_integration/core/window.cpp
  Vector2.new(10, 10)
end

#get_window_scale_dpiVector2

Gets the scale of the window

Returns:



282
283
284
285
286
# File 'mrb_doc/core/window.rb', line 282

def get_window_scale_dpi()
  # mrb_get_window_scale_dpi
  # src/mruby_integration/core/window.cpp
  Vector2.new(1, 1)
end

#get_world_to_screen2D(vector, camera) ⇒ Vector2

Translates the vector to where it is on the screen according to the camera

Parameters:

Returns:



5
6
7
8
9
# File 'mrb_doc/core/screen_space.rb', line 5

def get_world_to_screen2D(vector, camera)
  # mrb_get_world_to_screen2D
  # src/mruby_integration/core/screen_space.cpp
  Vector2.new
end

#hide_cursornil

Hides the cursor

Returns:

  • (nil)


11
12
13
14
15
# File 'mrb_doc/core/cursor.rb', line 11

def hide_cursor()
  # mrb_hide_cursor
  # src/mruby_integration/core/cursor.cpp
  nil
end

#image_alpha_mask!(image, alpha_mask) ⇒ nil

Applies the alpha of the mask to the image

Parameters:

Returns:

  • (nil)


110
111
112
113
114
# File 'mrb_doc/image.rb', line 110

def image_alpha_mask!(image, alpha_mask)
  # mrb_image_alpha_mask
  # src/mruby_integration/image.cpp
  nil
end

#image_alpha_premultiply!(image) ⇒ nil

Pre-multiplies the alpha for the image

Parameters:

Returns:

  • (nil)


119
120
121
122
123
# File 'mrb_doc/image.rb', line 119

def image_alpha_premultiply!(image)
  # mrb_image_alpha_premultiply
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_brightness!(image, brightness) ⇒ nil

Change the brightness of the image

Parameters:

  • image (Image)
  • brightness (Float)

    a value between -255 and 255

Returns:

  • (nil)


212
213
214
215
216
# File 'mrb_doc/image.rb', line 212

def image_colour_brightness!(image, brightness)
  # mrb_image_colour_brightness
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_contrast!(image, contrast) ⇒ nil

Change the contrast of the image

Parameters:

  • image (Image)
  • contrast (Float)

    a value between -100 and 100

Returns:

  • (nil)


202
203
204
205
206
# File 'mrb_doc/image.rb', line 202

def image_colour_contrast!(image, contrast)
  # mrb_image_colour_contrast
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_grayscale!(image) ⇒ nil

Converts the image to grayscale

Parameters:

Returns:

  • (nil)


192
193
194
195
196
# File 'mrb_doc/image.rb', line 192

def image_colour_grayscale!(image)
  # mrb_image_colour_grayscale
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_invert!(image) ⇒ nil

Inverts the colours of the image

Parameters:

Returns:

  • (nil)


183
184
185
186
187
# File 'mrb_doc/image.rb', line 183

def image_colour_invert!(image)
  # mrb_image_colour_invert
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_replace!(image, old_colour, new_colour) ⇒ nil

Replace the old Colour with the new Colour

Parameters:

Returns:

  • (nil)


223
224
225
226
227
# File 'mrb_doc/image.rb', line 223

def image_colour_replace!(image, old_colour, new_colour)
  # mrb_image_colour_replace
  # src/mruby_integration/image.cpp
  nil
end

#image_colour_tint!(image, colour) ⇒ nil

Tints the image with the specified colour

Parameters:

Returns:

  • (nil)


174
175
176
177
178
# File 'mrb_doc/image.rb', line 174

def image_colour_tint!(image, colour)
  # mrb_image_colour_tint
  # src/mruby_integration/image.cpp
  nil
end

#image_copy(image) ⇒ Image

Copies an image to a new object

Parameters:

Returns:



43
44
45
46
47
# File 'mrb_doc/image.rb', line 43

def image_copy(image)
  # mrb_image_copy
  # src/mruby_integration/image.cpp
  Image.new
end

#image_crop!(image, rectangle) ⇒ nil

Crops the image to the section in the rectangle

Parameters:

Returns:

  • (nil)


100
101
102
103
104
# File 'mrb_doc/image.rb', line 100

def image_crop!(image, rectangle)
  # mrb_image_crop
  # src/mruby_integration/image.cpp
  nil
end

#image_draw!(destination, source, source_rectangle, destination_rectangle, colour) ⇒ nil

Draws the specified portion of the source image into the specified region of the destination image.

Parameters:

Returns:

  • (nil)


237
238
239
240
241
# File 'mrb_doc/image.rb', line 237

def image_draw!(destination, source, source_rectangle, destination_rectangle, colour)
  # mrb_image_draw
  # src/mruby_integration/image.cpp
  nil
end

#image_flip_horizontal!(image) ⇒ nil

Flips the image horizontally

Parameters:

Returns:

  • (nil)


146
147
148
149
150
# File 'mrb_doc/image.rb', line 146

def image_flip_horizontal!(image)
  # mrb_image_flip_horizontal
  # src/mruby_integration/image.cpp
  nil
end

#image_flip_vertical!(image) ⇒ nil

Flips the image vertically

Parameters:

Returns:

  • (nil)


128
129
130
131
132
# File 'mrb_doc/image.rb', line 128

def image_flip_vertical!(image)
  # mrb_image_flip_vertical
  # src/mruby_integration/image.cpp
  nil
end

#image_from_image(image, source) ⇒ Image

Returns a subsection of an image

Parameters:

Returns:



53
54
55
56
57
# File 'mrb_doc/image.rb', line 53

def image_from_image(image, source)
  # mrb_image_from_image
  # src/mruby_integration/image.cpp
  Image.new
end

#image_mipmaps!(image) ⇒ nil

Generates mipmaps for the specified image

Parameters:

Returns:

  • (nil)


137
138
139
140
141
# File 'mrb_doc/image.rb', line 137

def image_mipmaps!(image)
  # mrb_image_mipmaps
  # src/mruby_integration/image.cpp
  nil
end

#image_resize!(image, width, height) ⇒ nil

Resizes the image using a bicubic scaling algorithm. Useful for things like photos, not great for pixel art.

Parameters:

  • image (Image)
  • width (Integer)
  • height (Integer)

Returns:

  • (nil)


78
79
80
81
82
# File 'mrb_doc/image.rb', line 78

def image_resize!(image, width, height)
  # mrb_image_resize
  # src/mruby_integration/image.cpp
  nil
end

#image_resize_nearest_neighbour!(image, width, height) ⇒ nil

Resizes the image using a nearest-neighbour scaling algorithm. Useful for things like pixel art, not great for photos.

Parameters:

  • image (Image)
  • width (Integer)
  • height (Integer)

Returns:

  • (nil)


90
91
92
93
94
# File 'mrb_doc/image.rb', line 90

def image_resize_nearest_neighbour!(image, width, height)
  # mrb_image_resize_nearest_neighbour
  # src/mruby_integration/image.cpp
  nil
end

#image_rotate_ccw!(image) ⇒ nil

Rotates the image counter-clockwise 90 degrees

Parameters:

Returns:

  • (nil)


164
165
166
167
168
# File 'mrb_doc/image.rb', line 164

def image_rotate_ccw!(image)
  # mrb_image_rotate_ccw
  # src/mruby_integration/image.cpp
  nil
end

#image_rotate_cw!(image) ⇒ nil

Rotates the image clockwise 90 degrees

Parameters:

Returns:

  • (nil)


155
156
157
158
159
# File 'mrb_doc/image.rb', line 155

def image_rotate_cw!(image)
  # mrb_image_rotate_cw
  # src/mruby_integration/image.cpp
  nil
end

#image_text_ex(font, text, font_size, font_padding, colour) ⇒ Image

Creates an image from the font

Parameters:

  • font (Font)

    Which font to draw with

  • text (String)

    The text to put on the screen

  • font_size (Integer)
  • font_padding (Integer)
  • colour (Colour)

Returns:



66
67
68
69
70
# File 'mrb_doc/image.rb', line 66

def image_text_ex(font, text, font_size, font_padding, colour)
  # mrb_image_text_ex
  # src/mruby_integration/image.cpp
  Image.new
end

#init_audio_devicenil

Initialises the audio device for playback

Returns:

  • (nil)


3
4
5
6
7
# File 'mrb_doc/audio/device.rb', line 3

def init_audio_device()
  # mrb_init_audio_device
  # src/mruby_integration/audio/device.cpp
  nil
end

#init_window(width, height, title) ⇒ nil

Initialises a window for rendering

Parameters:

  • width (Integer)
  • height (Integer)
  • title (String)

Returns:

  • (nil)


6
7
8
9
10
# File 'mrb_doc/core/window.rb', line 6

def init_window(width, height, title)
  # mrb_init_window
  # src/mruby_integration/core/window.cpp
  nil
end

#key_down?(key) ⇒ Boolean

Is the specified key down?

Parameters:

  • key (Integer)

Returns:

  • (Boolean)


13
14
15
16
17
# File 'mrb_doc/core/input/keyboard.rb', line 13

def key_down?(key)
  # mrb_key_down
  # src/mruby_integration/core/input/keyboard.cpp
  True
end

#key_pressed?(key) ⇒ Boolean

Has the specified key been pressed since last frame?

Parameters:

  • key (Integer)

Returns:

  • (Boolean)


4
5
6
7
8
# File 'mrb_doc/core/input/keyboard.rb', line 4

def key_pressed?(key)
  # mrb_key_pressed
  # src/mruby_integration/core/input/keyboard.cpp
  True
end

#key_released?(key) ⇒ Boolean

Has the specified key been released since last frame?

Parameters:

  • key (Integer)

Returns:

  • (Boolean)


22
23
24
25
26
# File 'mrb_doc/core/input/keyboard.rb', line 22

def key_released?(key)
  # mrb_key_released
  # src/mruby_integration/core/input/keyboard.cpp
  False
end

#key_up?(key) ⇒ Boolean

Is the specified key not down?

Parameters:

  • key (Integer)

Returns:

  • (Boolean)


31
32
33
34
35
# File 'mrb_doc/core/input/keyboard.rb', line 31

def key_up?(key)
  # mrb_key_up
  # src/mruby_integration/core/input/keyboard.cpp
  False
end

#linux?Boolean

Is the current platform Linux?

Returns:

  • (Boolean)


11
12
13
14
15
# File 'mrb_doc/platform.rb', line 11

def linux?
  # mrb_linux
  # src/platform.cpp
  true
end

#load_font(path) ⇒ Font

Loads a font from a file

Parameters:

  • path (String)

Returns:



4
5
6
7
8
# File 'mrb_doc/text.rb', line 4

def load_font(path)
  # mrb_load_font
  # src/mruby_integration/text.cpp
  Font.new
end

#load_font_ex(path, font_size, char_count) ⇒ Font

Loads a font from a file with extended options

Parameters:

  • path (String)
  • font_size (Integer)
  • char_count (Integer)

Returns:



15
16
17
18
19
# File 'mrb_doc/text.rb', line 15

def load_font_ex(path, font_size, char_count)
  # mrb_load_font_ex
  # src/mruby_integration/text.cpp
  Font.new
end

#load_image(path) ⇒ Image

Loads an image from a file

Parameters:

  • path (String)

Returns:



4
5
6
7
8
# File 'mrb_doc/image.rb', line 4

def load_image(path)
  # mrb_load_image
  # src/mruby_integration/image.cpp
  Image.new
end

#load_music_stream(path) ⇒ Music

Loads a music object from a file

Parameters:

  • path (String)

Returns:



4
5
6
7
8
# File 'mrb_doc/audio/music.rb', line 4

def load_music_stream(path)
  # mrb_load_music_stream
  # src/mruby_integration/audio/music.cpp
  Music.new
end

#load_shader(vertex_shader_path, fragment_shader_path) ⇒ Shader

Loads a shader from a file

Parameters:

  • vertex_shader_path (String)
  • fragment_shader_path (String)

Returns:



15
16
17
18
19
# File 'mrb_doc/shaders.rb', line 15

def load_shader(vertex_shader_path, fragment_shader_path)
  # mrb_load_shader
  # src/mruby_integration/shaders.cpp
  Shader.new
end

#load_shader_from_string(vertex_shader_code, fragment_shader_code) ⇒ Shader

Loads a shader from in memory strings

Parameters:

  • vertex_shader_code (String)
  • fragment_shader_code (String)

Returns:



5
6
7
8
9
# File 'mrb_doc/shaders.rb', line 5

def load_shader_from_string(vertex_shader_code, fragment_shader_code)
  # mrb_load_shader
  # src/mruby_integration/shaders.cpp
  Shader.new
end

#load_sound(path) ⇒ Sound

Loads a sound object from a file

Parameters:

  • path (String)

Returns:



4
5
6
7
8
# File 'mrb_doc/audio/sound.rb', line 4

def load_sound(path)
  # mrb_load_sound
  # src/mruby_integration/audio/sound.cpp
  Sound.new
end

#load_texture(path) ⇒ Texture2D

Loads a texture from a file

Parameters:

  • path (String)

Returns:



4
5
6
7
8
# File 'mrb_doc/textures.rb', line 4

def load_texture(path)
  # mrb_load_texture
  # src/mruby_integration/textures.cpp
  Texture2D.new
end

#load_texture_from_image(image) ⇒ Texture2D

Loads a texture from an image object

Parameters:

Returns:



13
14
15
16
17
# File 'mrb_doc/textures.rb', line 13

def load_texture_from_image(image)
  # mrb_load_texture_from_image
  # src/mruby_integration/textures.cpp
  Texture2D.new
end

#maximise_windownil

Maximises the window

Returns:

  • (nil)


124
125
126
127
128
# File 'mrb_doc/core/window.rb', line 124

def maximise_window()
  # mrb_maximise_window
  # src/mruby_integration/core/window.cpp
  nil
end

#measure_text_ex(font, text, font_size, font_padding) ⇒ Vector2

Returns the size of the text for the given font

Parameters:

  • font (Font)

    Which font to draw with

  • text (String)

    The text to put on the screen

  • font_size (Integer)
  • font_padding (Integer)

Returns:



73
74
75
76
77
# File 'mrb_doc/text.rb', line 73

def measure_text_ex(font, text, font_size, font_padding)
  # mrb_measure_text_ex
  # src/mruby_integration/text.cpp
  Vector2.new(32, 12)
end

#minimise_windownil

Minimises the window

Returns:

  • (nil)


132
133
134
135
136
# File 'mrb_doc/core/window.rb', line 132

def minimise_window()
  # mrb_minimise_window
  # src/mruby_integration/core/window.cpp
  nil
end

#mouse_button_down?(button) ⇒ Boolean

Is the specified mouse button down?

Parameters:

  • button (Integer)

Returns:

  • (Boolean)


13
14
15
16
17
# File 'mrb_doc/core/input/mouse.rb', line 13

def mouse_button_down?(button)
  # mrb_mouse_button_down
  # src/mruby_integration/core/input/mouse.cpp
  true
end

#mouse_button_pressed?(button) ⇒ Boolean

Is the specified mouse button pressed?

Parameters:

  • button (Integer)

Returns:

  • (Boolean)


4
5
6
7
8
# File 'mrb_doc/core/input/mouse.rb', line 4

def mouse_button_pressed?(button)
  # mrb_mouse_button_pressed
  # src/mruby_integration/core/input/mouse.cpp
  true
end

#mouse_button_released?(button) ⇒ Boolean

Has the specified mouse button been released?

Parameters:

  • button (Integer)

Returns:

  • (Boolean)


22
23
24
25
26
# File 'mrb_doc/core/input/mouse.rb', line 22

def mouse_button_released?(button)
  # mrb_mouse_button_released
  # src/mruby_integration/core/input/mouse.cpp
  false
end

#mouse_button_up?(button) ⇒ Boolean

Is the specified mouse button not down?

Parameters:

  • button (Integer)

Returns:

  • (Boolean)


31
32
33
34
35
# File 'mrb_doc/core/input/mouse.rb', line 31

def mouse_button_up?(button)
  # mrb_mouse_button_up
  # src/mruby_integration/core/input/mouse.cpp
  false
end

#music_playing?(music) ⇒ Boolean

Checks whether or not a music object is currently playing

Parameters:

Returns:

  • (Boolean)


31
32
33
34
35
# File 'mrb_doc/audio/music.rb', line 31

def music_playing?(music)
  # mrb_music_playing
  # src/mruby_integration/audio/music.cpp
  true
end

#open_url(url) ⇒ nil

Opens the URL in the users browser

Parameters:

  • url (String)

Returns:

  • (nil)


35
36
37
38
39
# File 'mrb_doc/core/misc.rb', line 35

def open_url(url)
  # mrb_open_url
  # src/mruby_integration/core/misc.cpp
  nil
end

#osx?Boolean

Is the current platform OSX?

Returns:

  • (Boolean)


27
28
29
30
31
# File 'mrb_doc/platform.rb', line 27

def osx?
  # mrb_osx
  # src/platform.cpp
  false
end

#pause_music_stream(music) ⇒ nil

Pauses a music object so it can be resumed

Parameters:

Returns:

  • (nil)


58
59
60
61
62
# File 'mrb_doc/audio/music.rb', line 58

def pause_music_stream(music)
  # mrb_pause_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#pause_sound(sound) ⇒ nil

Pauses a sound object so it can be resumed

Parameters:

Returns:

  • (nil)


40
41
42
43
44
# File 'mrb_doc/audio/sound.rb', line 40

def pause_sound(sound)
  # mrb_pause_sound
  # src/mruby_integration/audio/sound.cpp
  nil
end

#persist_buildkite_test_analyticsObject



111
112
113
114
115
# File 'src/ruby/core/buildkite_analytics.rb', line 111

def persist_buildkite_test_analytics
  output = File.open('test-analytics.json', 'w')
  output.write($buildkite_test_analytics.to_json)
  output.close
end

#play_music_stream(music) ⇒ nil

Starts playback of a music object from the beginning

Parameters:

Returns:

  • (nil)


22
23
24
25
26
# File 'mrb_doc/audio/music.rb', line 22

def play_music_stream(music)
  # mrb_play_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#play_sound(sound) ⇒ nil

Plays a sound object

Parameters:

Returns:

  • (nil)


22
23
24
25
26
# File 'mrb_doc/audio/sound.rb', line 22

def play_sound(sound)
  # mrb_play_sound
  # src/mruby_integration/audio/sound.cpp
  nil
end

#released?Boolean

Is this a release build?

Returns:

  • (Boolean)


43
44
45
46
47
# File 'mrb_doc/platform.rb', line 43

def released?
  # mrb_released
  # src/platform.cpp
  true
end

#restore_windownil

Note:

I don’t think it currently works for restoring from minimised

Restores the window from being maximised or minimised

Returns:

  • (nil)


141
142
143
144
145
# File 'mrb_doc/core/window.rb', line 141

def restore_window()
  # mrb_restore_window
  # src/mruby_integration/core/window.cpp
  nil
end

#resume_music_stream(music) ⇒ nil

Resumes a paused music object

Parameters:

Returns:

  • (nil)


67
68
69
70
71
# File 'mrb_doc/audio/music.rb', line 67

def resume_music_stream(music)
  # mrb_resume_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#resume_sound(sound) ⇒ nil

Resumes a paused sound object

Parameters:

Returns:

  • (nil)


49
50
51
52
53
# File 'mrb_doc/audio/sound.rb', line 49

def resume_sound(sound)
  # mrb_resume_sound
  # src/mruby_integration/audio/sound.cpp
  nil
end

#scissor_mode(section) { ... } ⇒ nil

Allows you to call rendering functions within the block but limits the output to within the bounds of section

Parameters:

Yields:

  • The block that calls your rendering logic

Returns:

  • (nil)


23
24
25
26
27
28
# File 'src/ruby/core/drawing.rb', line 23

def scissor_mode(section, &block)
  begin_scissor_mode(section.x, section.y, section.width, section.height)
  block.call
ensure
  end_scissor_mode
end

#set_clipboard_text(text) ⇒ nil

Sets the clipboard value

Parameters:

  • text (String)

Returns:

  • (nil)


44
45
46
47
48
# File 'mrb_doc/core/misc.rb', line 44

def set_clipboard_text(text)
  # mrb_set_clipboard_text
  # src/mruby_integration/core/misc.cpp
  nil
end

#set_config_flags(flags) ⇒ nil

Enable specific config flags, to pass in multiple you can do so like: set_config_flags(FLAG_WINDOW_TOPMOST | FLAG_WINDOW_RESIZABLE)

Parameters:

  • flags (Integer)

Returns:

  • (nil)


17
18
19
20
21
# File 'mrb_doc/core/misc.rb', line 17

def set_config_flags(flags)
  # mrb_set_config_flags
  # src/mruby_integration/core/misc.cpp
  nil
end

#set_exit_key(key) ⇒ nil

Sets the key for should_window_close? to listen for

Parameters:

  • key (Integer)

Returns:

  • (nil)


40
41
42
43
44
# File 'mrb_doc/core/input/keyboard.rb', line 40

def set_exit_key(key)
  # mrb_set_exit_key
  # src/mruby_integration/core/input/keyboard.cpp
  nil
end

#set_gamepad_mappings(mappings) ⇒ Integer

Setup gamepad mappings using the SDL_GameControllerDB format

Parameters:

  • mappings (String)

Returns:

  • (Integer)


90
91
92
93
94
# File 'mrb_doc/core/input/gamepad.rb', line 90

def set_gamepad_mappings(mappings)
  # mrb_set_gamepad_mappings
  # src/mruby_integration/core/input/gamepad.cpp
  1
end

#set_gestures_enabled(flags) ⇒ nil

Enable only specific gestures, to pass in multiple you can do so like: set_gestures_enabled(GESTURE_TAP | GESTURE_SWIPE_UP)

Parameters:

  • flags (Integer)

Returns:

  • (nil)


5
6
7
8
9
# File 'mrb_doc/core/gestures.rb', line 5

def set_gestures_enabled(flags)
  # mrb_set_gestures_enabled
  # src/mruby_integration/core/gestures.cpp
  nil
end

#set_main_loop(method) ⇒ nil

Sets the main loop for web exports

Parameters:

  • method (String)

Returns:

  • (nil)

Raises:

  • (PlatformSpecificMethodCalledOnWrongPlatformError)

    If run on the wrong platform



5
6
7
8
9
# File 'mrb_doc/web.rb', line 5

def set_main_loop(method)
  # mrb_set_main_loop
  # src/web.cpp
  nil
end

#set_master_volume(volume) ⇒ nil

Sets the master volume

Parameters:

  • volume (Float)

    a value between 0.0 and 1.0

Returns:

  • (nil)


28
29
30
31
32
# File 'mrb_doc/audio/device.rb', line 28

def set_master_volume(volume)
  # mrb_set_master_volume
  # src/mruby_integration/audio/device.cpp
  nil
end

#set_mouse_cursor(cursor) ⇒ nil

Sets the mouse cursor

Parameters:

  • cursor (Integer)

Returns:

  • (nil)


102
103
104
105
106
# File 'mrb_doc/core/input/mouse.rb', line 102

def set_mouse_cursor(cursor)
  # mrb_set_mouse_cursor
  # src/mruby_integration/core/input/mouse.cpp
  nil
end

#set_mouse_offset(x, y) ⇒ nil

Sets the offset for all mouse position functions

Parameters:

  • x (Integer)
  • y (Integer)

Returns:

  • (nil)


75
76
77
78
79
# File 'mrb_doc/core/input/mouse.rb', line 75

def set_mouse_offset(x, y)
  # mrb_set_mouse_offset
  # src/mruby_integration/core/input/mouse.cpp
  nil
end

#set_mouse_position(x, y) ⇒ nil

Sets the position of the muose

Parameters:

  • x (Integer)
  • y (Integer)

Returns:

  • (nil)


65
66
67
68
69
# File 'mrb_doc/core/input/mouse.rb', line 65

def set_mouse_position(x, y)
  # mrb_set_mouse_position
  # src/mruby_integration/core/input/mouse.cpp
  nil
end

#set_mouse_scale(x, y) ⇒ nil

Sets the scaling for all mouse position functions

Parameters:

  • x (Float)
  • y (Float)

Returns:

  • (nil)


85
86
87
88
89
# File 'mrb_doc/core/input/mouse.rb', line 85

def set_mouse_scale(x, y)
  # mrb_set_mouse_scale
  # src/mruby_integration/core/input/mouse.cpp
  nil
end

#set_music_pitch(music, pitch) ⇒ nil

Sets pitch for a music object

Parameters:

  • music (Music)
  • pitch (Float)

Returns:

  • (nil)


87
88
89
90
91
# File 'mrb_doc/audio/music.rb', line 87

def set_music_pitch(music, pitch)
  # mrb_set_music_pitch
  # src/mruby_integration/audio/music.cpp
  nil
end

#set_music_volume(music, volume) ⇒ nil

Sets volume for a music object

Parameters:

  • music (Music)
  • volume (Float)

    A value between 0.0 and 1.0

Returns:

  • (nil)


77
78
79
80
81
# File 'mrb_doc/audio/music.rb', line 77

def set_music_volume(music, volume)
  # mrb_set_music_volume
  # src/mruby_integration/audio/music.cpp
  nil
end

#set_shader_values(shader, variable_location, variables, variable_type) ⇒ Integer

Returns the location of uniform variable, will return -1 if not found.

Parameters:

Returns:

  • (Integer)


55
56
57
58
59
# File 'mrb_doc/shaders.rb', line 55

def set_shader_values(shader, variable_location, variables, variable_type)
  # mrb_set_shader_values
  # src/mruby_integration/shaders.cpp
  1
end

#set_sound_pitch(sound, pitch) ⇒ nil

Sets the pitch of the sound object

Parameters:

  • sound (Sound)
  • pitch (Float)

Returns:

  • (nil)


79
80
81
82
83
# File 'mrb_doc/audio/sound.rb', line 79

def set_sound_pitch(sound, pitch)
  # mrb_set_sound_pitch
  # src/mruby_integration/audio/sound.cpp
  1
end

#set_sound_volume(sound, volume) ⇒ nil

Sets the volume of the sound object

Parameters:

  • sound (Sound)
  • volume (Float)

    a value between 0.0 and 1.0

Returns:

  • (nil)


69
70
71
72
73
# File 'mrb_doc/audio/sound.rb', line 69

def set_sound_volume(sound, volume)
  # mrb_set_sound_volume
  # src/mruby_integration/audio/sound.cpp
  1
end

#set_target_fps(target) ⇒ nil

Set the framerate you wish to target (usually 60, 120, or 144)

Parameters:

  • target (Integer)

Returns:

  • (nil)


4
5
6
7
8
# File 'mrb_doc/core/timing.rb', line 4

def set_target_fps(target)
  # mrb_set_target_fps
  # src/mruby_integration/core/timing.cpp
  nil
end

#set_texture_filter(texture, filter) ⇒ nil

Sets the filtering for the Texture2D

Parameters:

Returns:

  • (nil)


77
78
79
80
81
# File 'mrb_doc/textures.rb', line 77

def set_texture_filter(texture, filter)
  # mrb_set_texture_filter
  # src/mruby_integration/textures.cpp
  nil
end

#set_trace_log_level(level) ⇒ nil

Sets the logging level

Parameters:

  • level (Integer)

    A value between 0 and 5

Returns:

  • (nil)


26
27
28
29
30
# File 'mrb_doc/core/misc.rb', line 26

def set_trace_log_level(level)
  # mrb_set_trace_log_level
  # src/mruby_integration/core/misc.cpp
  nil
end

#set_window_icon(image) ⇒ nil

Sets the icon for the current window

Parameters:

Returns:

  • (nil)


150
151
152
153
154
# File 'mrb_doc/core/window.rb', line 150

def set_window_icon(image)
  # mrb_set_window_icon
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_min_size(width, height) ⇒ nil

Sets the minimum allowed size for the current window

Parameters:

  • width (Integer)
  • height (Integer)

Returns:

  • (nil)


188
189
190
191
192
# File 'mrb_doc/core/window.rb', line 188

def set_window_min_size(width, height)
  # mrb_set_window_min_size
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_monitor(monitor) ⇒ nil

Sets the monitor for the current window

Parameters:

  • monitor (Integer)

Returns:

  • (nil)


178
179
180
181
182
# File 'mrb_doc/core/window.rb', line 178

def set_window_monitor(monitor)
  # mrb_set_window_monitor
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_position(x, y) ⇒ nil

Sets the position for the current window

Parameters:

  • x (Integer)
  • y (Integer)

Returns:

  • (nil)


169
170
171
172
173
# File 'mrb_doc/core/window.rb', line 169

def set_window_position(x, y)
  # mrb_set_window_position
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_size(width, height) ⇒ nil

Sets the size for the current window

Parameters:

  • width (Integer)
  • height (Integer)

Returns:

  • (nil)


198
199
200
201
202
# File 'mrb_doc/core/window.rb', line 198

def set_window_size(width, height)
  # mrb_set_window_size
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_state(flags) ⇒ nil

Sets the specified states on the window, to pass in multiple you can do so like: set_window_state(FLAG_WINDOW_ALWAYS_RUN | FLAG_WINDOW_HIDDEN)

Parameters:

  • flags (Integer)

Returns:

  • (nil)


50
51
52
53
54
# File 'mrb_doc/core/window.rb', line 50

def set_window_state(flags)
  # mrb_clear_window_state
  # src/mruby_integration/core/window.cpp
  nil
end

#set_window_title(title) ⇒ nil

Sets the title for the current window

Parameters:

  • title (String)

Returns:

  • (nil)


159
160
161
162
163
# File 'mrb_doc/core/window.rb', line 159

def set_window_title(title)
  # mrb_set_window_title
  # src/mruby_integration/core/window.cpp
  nil
end

#shader_ready?(shader) ⇒ Boolean

Checks if the shader is ready

Parameters:

Returns:

  • (Boolean)


33
34
35
36
37
# File 'mrb_doc/shaders.rb', line 33

def shader_ready?(shader)
  # mrb_shader_ready
  # src/mruby_integration/shaders.cpp
  True
end

#show_cursornil

Shows the cursor

Returns:

  • (nil)


3
4
5
6
7
# File 'mrb_doc/core/cursor.rb', line 3

def show_cursor()
  # mrb_show_cursor
  # src/mruby_integration/core/cursor.cpp
  nil
end

#sound_playing?(sound) ⇒ Boolean

Checks whether or not a sound object is currently playing

Parameters:

Returns:

  • (Boolean)


58
59
60
61
62
# File 'mrb_doc/audio/sound.rb', line 58

def sound_playing?(sound)
  # mrb_sound_playing
  # src/mruby_integration/audio/sound.cpp
  true
end

#stop_music_stream(music) ⇒ nil

Stops a music object from playing

Parameters:

Returns:

  • (nil)


49
50
51
52
53
# File 'mrb_doc/audio/music.rb', line 49

def stop_music_stream(music)
  # mrb_stop_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#stop_sound(sound) ⇒ nil

Stops a sound object

Parameters:

Returns:

  • (nil)


31
32
33
34
35
# File 'mrb_doc/audio/sound.rb', line 31

def stop_sound(sound)
  # mrb_stop_sound
  # src/mruby_integration/audio/sound.cpp
  nil
end

#take_screenshot(filename) ⇒ nil

You’ll want to call this function after you’ve called end_drawing or you’ll find that you don’t get everything that you think you’ve drawn.

The extension of filename will dictate how the screenshot is saved.

Parameters:

  • filename (String)

Returns:

  • (nil)


7
8
9
10
11
# File 'mrb_doc/core/misc.rb', line 7

def take_screenshot(filename)
  # mrb_take_screenshot
  # src/mruby_integration/core/misc.cpp
  nil
end

#toggle_fullscreennil

Toggles the fullscreen state

Returns:

  • (nil)


116
117
118
119
120
# File 'mrb_doc/core/window.rb', line 116

def toggle_fullscreen()
  # mrb_toggle_fullscreen
  # src/mruby_integration/core/window.cpp
  nil
end

#unload_font(font) ⇒ nil

Unloads a font from memory

Parameters:

Returns:

  • (nil)


24
25
26
27
28
# File 'mrb_doc/text.rb', line 24

def unload_font(font)
  # mrb_unload_font
  # src/mruby_integration/text.cpp
  nil
end

#unload_image(image) ⇒ nil

Unloads an image

Parameters:

Returns:

  • (nil)


13
14
15
16
17
# File 'mrb_doc/image.rb', line 13

def unload_image(image)
  # mrb_unload_image
  # src/mruby_integration/image.cpp
  nil
end

#unload_music_stream(music) ⇒ nil

Unloads a music object

Parameters:

Returns:

  • (nil)


13
14
15
16
17
# File 'mrb_doc/audio/music.rb', line 13

def unload_music_stream(music)
  # mrb_unload_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#unload_shader(shader) ⇒ nil

Unloads a shader

Parameters:

Returns:

  • (nil)


24
25
26
27
28
# File 'mrb_doc/shaders.rb', line 24

def unload_shader(shader)
  # mrb_unload_shader
  # src/mruby_integration/shaders.cpp
  nil
end

#unload_sound(sound) ⇒ nil

Unloads a sound object

Parameters:

Returns:

  • (nil)


13
14
15
16
17
# File 'mrb_doc/audio/sound.rb', line 13

def unload_sound(sound)
  # mrb_load_sound
  # src/mruby_integration/audio/sound.cpp
  nil
end

#unload_texture(texture) ⇒ nil

Unloads a texture

Parameters:

Returns:

  • (nil)


22
23
24
25
26
# File 'mrb_doc/textures.rb', line 22

def unload_texture(texture)
  # mrb_unload_texture
  # src/mruby_integration/textures.cpp
  nil
end

#update_music_stream(music) ⇒ nil

Updates the buffer for the specified music, you should call this every frame

Parameters:

Returns:

  • (nil)


40
41
42
43
44
# File 'mrb_doc/audio/music.rb', line 40

def update_music_stream(music)
  # mrb_update_music_stream
  # src/mruby_integration/audio/music.cpp
  nil
end

#upload_buildkite_test_analyticsObject



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'src/ruby/core/buildkite_analytics.rb', line 73

def upload_buildkite_test_analytics
  return unless ENV['BUILDKITE_TEST_ANALYTICS_KEY']
  puts
  puts "Found a Buildkite test analytics key, let's upload our results!"
  puts "..."

  client = SimpleHttp.new('https', 'analytics-api.buildkite.com', 443)
  response = client.request(
    "POST",
    '/v1/uploads',
    {
      'Authorization' => "Token token=\"#{ENV['BUILDKITE_TEST_ANALYTICS_KEY']}\"",
      'Content-Type' => 'application/json',
      'Body' => {
        format: 'json',
        run_env: {
          "CI" => "buildkite",
          "key" => ENV['BUILDKITE_BUILD_ID'],
          "number" => ENV['BUILDKITE_BUILD_NUMBER'],
          "job_id" => ENV['BUILDKITE_JOB_ID'],
          "branch" => ENV['BUILDKITE_BRANCH'],
          "commit_sha" => ENV['BUILDKITE_COMMIT'],
          "message" => ENV['BUILDKITE_MESSAGE'],
          "url" => ENV['BUILDKITE_BUILD_URL']
        },
        data: $buildkite_test_analytics
      }.to_json
    }
  )

  response_data = JSON.parse(response.body)
  puts "ID: #{response_data['id']}"
  puts "Run ID: #{response_data['run_id']}"
  puts "Queued: #{response_data['queued']}"

  puts "Done!"
end

#window_focused?Boolean

Checks if the window has focus

Returns:

  • (Boolean)


90
91
92
93
94
# File 'mrb_doc/core/window.rb', line 90

def window_focused?()
  # mrb_window_focused
  # src/mruby_integration/core/window.cpp
  true
end

#window_fullscreen?Boolean

Checks if the window has the FLAG_FULLSCREEN_MODE state set

Returns:

  • (Boolean)


58
59
60
61
62
# File 'mrb_doc/core/window.rb', line 58

def window_fullscreen?()
  # mrb_window_fullscreen
  # src/mruby_integration/core/window.cpp
  true
end

#window_hidden?Boolean

Checks if the window has the FLAG_WINDOW_HIDDEN state set

Returns:

  • (Boolean)


66
67
68
69
70
# File 'mrb_doc/core/window.rb', line 66

def window_hidden?()
  # mrb_window_hidden
  # src/mruby_integration/core/window.cpp
  false
end

#window_maximised?Boolean

Checks if the window has the FLAG_WINDOW_MAXIMISED state set

Returns:

  • (Boolean)


82
83
84
85
86
# File 'mrb_doc/core/window.rb', line 82

def window_maximised?()
  # mrb_window_maximised
  # src/mruby_integration/core/window.cpp
  true
end

#window_minimised?Boolean

Checks if the window has the FLAG_WINDOW_MINIMISED state set

Returns:

  • (Boolean)


74
75
76
77
78
# File 'mrb_doc/core/window.rb', line 74

def window_minimised?()
  # mrb_window_minimised
  # src/mruby_integration/core/window.cpp
  false
end

#window_ready?Boolean

Has the window been initialised and ready for rendering?

Returns:

  • (Boolean)


30
31
32
33
34
# File 'mrb_doc/core/window.rb', line 30

def window_ready?()
  # mrb_window_ready
  # src/mruby_integration/core/window.cpp
  true
end

#window_resized?Boolean

Checks if the window was resized since the last frame

Returns:

  • (Boolean)


98
99
100
101
102
# File 'mrb_doc/core/window.rb', line 98

def window_resized?()
  # mrb_window_resized
  # src/mruby_integration/core/window.cpp
  false
end

#window_should_close?Boolean

Has the user pressed ESC or the close button?

Returns:

  • (Boolean)


14
15
16
17
18
# File 'mrb_doc/core/window.rb', line 14

def window_should_close?()
  # mrb_window_should_close
  # src/mruby_integration/core/window.cpp
  false
end

#window_state?(flags) ⇒ Boolean

Checks if the window has the state set, to pass in multiple you can do so like: window_state?(FLAG_WINDOW_ALWAYS_RUN | FLAG_WINDOW_HIDDEN)

Parameters:

  • flags (Integer)

Returns:

  • (Boolean)


40
41
42
43
44
# File 'mrb_doc/core/window.rb', line 40

def window_state?(flags)
  # mrb_window_state
  # src/mruby_integration/core/window.cpp
  true
end

#windows?Boolean

Is the current platform Windows?

Returns:

  • (Boolean)


19
20
21
22
23
# File 'mrb_doc/platform.rb', line 19

def windows?
  # mrb_windows
  # src/platform.cpp
  false
end