Module: Cute

Defined in:
docstub/text.rb,
docstub/color.rb,
docstub/circle.rb,
docstub/sprite.rb,
mrblib/v2.rb,
mrblib/sprite.rb,
mrblib/version.rb,
mrblib/transform.rb

Defined Under Namespace

Classes: Circle, Color, Pixel, Sprite, Transform, V2

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cf_draw_circle(circle, thickness) ⇒ nil

Parameters:

  • circle (Circle)

    The circle to draw

  • thickness (Float)

    The thickness of the outline (use 0 or negative for filled)

Returns:

  • (nil)


65
66
# File 'docstub/circle.rb', line 65

def self.cf_draw_circle(circle, thickness)
end

.cf_draw_circle2(position, radius, thickness) ⇒ nil

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

  • thickness (Float)

    The thickness of the outline (use 0 or negative for filled)

Returns:

  • (nil)


74
75
# File 'docstub/circle.rb', line 74

def self.cf_draw_circle2(position, radius, thickness)
end

.cf_draw_circle_fill(circle) ⇒ nil

Parameters:

  • circle (Circle)

    The circle to draw

Returns:

  • (nil)


81
82
# File 'docstub/circle.rb', line 81

def self.cf_draw_circle_fill(circle)
end

.cf_draw_circle_fill2(position, radius) ⇒ nil

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

Returns:

  • (nil)


89
90
# File 'docstub/circle.rb', line 89

def self.cf_draw_circle_fill2(position, radius)
end

.cf_draw_text(text, position, num_chars_to_draw = -1)) ⇒ nil

Parameters:

  • text (String)

    The text to draw

  • position (V2)

    The top-left corner of the text

  • num_chars_to_draw (Integer) (defaults to: -1))

    (optional) The number of characters to draw. Use -1 to draw the whole string

Returns:

  • (nil)


42
43
# File 'docstub/text.rb', line 42

def self.cf_draw_text(text, position, num_chars_to_draw = -1)
end

.cf_make_font(path, font_name) ⇒ Result

Returns A result indicating success or failure.

Parameters:

  • path (String)

    The path to the font file

  • font_name (String)

    The unique name for this font

Returns:

  • (Result)

    A result indicating success or failure



7
8
# File 'docstub/text.rb', line 7

def self.cf_make_font(path, font_name)
end

.cf_pop_fontnil

Returns:

  • (nil)


20
21
# File 'docstub/text.rb', line 20

def self.cf_pop_font
end

.cf_pop_font_sizenil

Returns:

  • (nil)


33
34
# File 'docstub/text.rb', line 33

def self.cf_pop_font_size
end

.cf_push_font(font_name) ⇒ nil

Parameters:

  • font_name (String)

    The name of the font to use

Returns:

  • (nil)


14
15
# File 'docstub/text.rb', line 14

def self.cf_push_font(font_name)
end

.cf_push_font_size(size) ⇒ nil

Parameters:

  • size (Float)

    The font size to use

Returns:

  • (nil)


27
28
# File 'docstub/text.rb', line 27

def self.cf_push_font_size(size)
end

.cf_text_height(text, num_chars_to_draw = -1)) ⇒ Float

Returns The height of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer) (defaults to: -1))

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (Float)

    The height of the text in pixels



58
59
# File 'docstub/text.rb', line 58

def self.cf_text_height(text, num_chars_to_draw = -1)
end

.cf_text_size(text, num_chars_to_draw = -1)) ⇒ V2

Returns The size of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer) (defaults to: -1))

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (V2)

    The size of the text in pixels



66
67
# File 'docstub/text.rb', line 66

def self.cf_text_size(text, num_chars_to_draw = -1)
end

.cf_text_width(text, num_chars_to_draw = -1)) ⇒ Float

Returns The width of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer) (defaults to: -1))

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (Float)

    The width of the text in pixels



50
51
# File 'docstub/text.rb', line 50

def self.cf_text_width(text, num_chars_to_draw = -1)
end

.Circle(position, radius) ⇒ Circle

Returns A new Circle instance.

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

Returns:

  • (Circle)

    A new Circle instance



57
58
# File 'docstub/circle.rb', line 57

def self.Circle(position, radius)
end

.color_blackColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



245
246
# File 'docstub/color.rb', line 245

def self.color_black
end

.color_blueColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



269
270
# File 'docstub/color.rb', line 269

def self.color_blue
end

.color_clearColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



239
240
# File 'docstub/color.rb', line 239

def self.color_clear
end

.color_cyanColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



281
282
# File 'docstub/color.rb', line 281

def self.color_cyan
end

.color_greenColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



263
264
# File 'docstub/color.rb', line 263

def self.color_green
end

.color_greyColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



293
294
# File 'docstub/color.rb', line 293

def self.color_grey
end

.color_hex(hex) ⇒ Color

Returns A new Color instance.

Parameters:

  • hex (Integer)

    Hexadecimal color value (e.g., 0xFF0000 for red)

Returns:

  • (Color)

    A new Color instance



233
234
# File 'docstub/color.rb', line 233

def self.color_hex(hex)
end

.color_magentaColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



287
288
# File 'docstub/color.rb', line 287

def self.color_magenta
end

.color_redColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



257
258
# File 'docstub/color.rb', line 257

def self.color_red
end

.color_whiteColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



251
252
# File 'docstub/color.rb', line 251

def self.color_white
end

.color_yellowColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



275
276
# File 'docstub/color.rb', line 275

def self.color_yellow
end

.pixel_hex(hex) ⇒ Pixel

Returns A new Pixel instance.

Parameters:

  • hex (Integer)

    Hexadecimal color value

Returns:

  • (Pixel)

    A new Pixel instance



319
320
# File 'docstub/color.rb', line 319

def self.pixel_hex(hex)
end

.pixel_rgb(r, g, b) ⇒ Pixel

Returns A new Pixel instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

Returns:

  • (Pixel)

    A new Pixel instance



302
303
# File 'docstub/color.rb', line 302

def self.pixel_rgb(r, g, b)
end

.pixel_rgba(r, g, b, a) ⇒ Pixel

Returns A new Pixel instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

  • a (Integer)

    Alpha component (0 to 255)

Returns:

  • (Pixel)

    A new Pixel instance



312
313
# File 'docstub/color.rb', line 312

def self.pixel_rgba(r, g, b, a)
end

.rgb(r, g, b) ⇒ Color

Returns A new Color instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

Returns:

  • (Color)

    A new Color instance



216
217
# File 'docstub/color.rb', line 216

def self.rgb(r, g, b)
end

.rgb_f(r, g, b) ⇒ Color

Returns A new Color instance.

Parameters:

  • r (Float)

    Red component (0.0 to 1.0)

  • g (Float)

    Green component (0.0 to 1.0)

  • b (Float)

    Blue component (0.0 to 1.0)

Returns:

  • (Color)

    A new Color instance



197
198
# File 'docstub/color.rb', line 197

def self.rgb_f(r, g, b)
end

.rgba(r, g, b, a) ⇒ Color

Returns A new Color instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

  • a (Integer)

    Alpha component (0 to 255)

Returns:

  • (Color)

    A new Color instance



226
227
# File 'docstub/color.rb', line 226

def self.rgba(r, g, b, a)
end

.rgba_f(r, g, b, a) ⇒ Color

Returns A new Color instance.

Parameters:

  • r (Float)

    Red component (0.0 to 1.0)

  • g (Float)

    Green component (0.0 to 1.0)

  • b (Float)

    Blue component (0.0 to 1.0)

  • a (Float)

    Alpha component (0.0 to 1.0)

Returns:

  • (Color)

    A new Color instance



207
208
# File 'docstub/color.rb', line 207

def self.rgba_f(r, g, b, a)
end

Instance Method Details

#cf_draw_circlenil

Parameters:

  • circle (Circle)

    The circle to draw

  • thickness (Float)

    The thickness of the outline (use 0 or negative for filled)

Returns:

  • (nil)


65
66
# File 'docstub/circle.rb', line 65

def self.cf_draw_circle(circle, thickness)
end

#cf_draw_circle2nil

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

  • thickness (Float)

    The thickness of the outline (use 0 or negative for filled)

Returns:

  • (nil)


74
75
# File 'docstub/circle.rb', line 74

def self.cf_draw_circle2(position, radius, thickness)
end

#cf_draw_circle_fillnil

Parameters:

  • circle (Circle)

    The circle to draw

Returns:

  • (nil)


81
82
# File 'docstub/circle.rb', line 81

def self.cf_draw_circle_fill(circle)
end

#cf_draw_circle_fill2nil

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

Returns:

  • (nil)


89
90
# File 'docstub/circle.rb', line 89

def self.cf_draw_circle_fill2(position, radius)
end

#cf_draw_textnil

Parameters:

  • text (String)

    The text to draw

  • position (V2)

    The top-left corner of the text

  • num_chars_to_draw (Integer)

    (optional) The number of characters to draw. Use -1 to draw the whole string

Returns:

  • (nil)


42
43
# File 'docstub/text.rb', line 42

def self.cf_draw_text(text, position, num_chars_to_draw = -1)
end

#cf_make_fontResult

Returns A result indicating success or failure.

Parameters:

  • path (String)

    The path to the font file

  • font_name (String)

    The unique name for this font

Returns:

  • (Result)

    A result indicating success or failure



7
8
# File 'docstub/text.rb', line 7

def self.cf_make_font(path, font_name)
end

#cf_pop_fontnil

Returns:

  • (nil)


20
21
# File 'docstub/text.rb', line 20

def self.cf_pop_font
end

#cf_pop_font_sizenil

Returns:

  • (nil)


33
34
# File 'docstub/text.rb', line 33

def self.cf_pop_font_size
end

#cf_push_fontnil

Parameters:

  • font_name (String)

    The name of the font to use

Returns:

  • (nil)


14
15
# File 'docstub/text.rb', line 14

def self.cf_push_font(font_name)
end

#cf_push_font_sizenil

Parameters:

  • size (Float)

    The font size to use

Returns:

  • (nil)


27
28
# File 'docstub/text.rb', line 27

def self.cf_push_font_size(size)
end

#cf_text_heightFloat

Returns The height of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer)

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (Float)

    The height of the text in pixels



58
59
# File 'docstub/text.rb', line 58

def self.cf_text_height(text, num_chars_to_draw = -1)
end

#cf_text_sizeV2

Returns The size of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer)

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (V2)

    The size of the text in pixels



66
67
# File 'docstub/text.rb', line 66

def self.cf_text_size(text, num_chars_to_draw = -1)
end

#cf_text_widthFloat

Returns The width of the text in pixels.

Parameters:

  • text (String)

    The text to measure

  • num_chars_to_draw (Integer)

    (optional) The number of characters to consider. Use -1 for the whole string

Returns:

  • (Float)

    The width of the text in pixels



50
51
# File 'docstub/text.rb', line 50

def self.cf_text_width(text, num_chars_to_draw = -1)
end

#CircleCircle

Returns A new Circle instance.

Parameters:

  • position (V2)

    The position vector for the center of the circle

  • radius (Float)

    The radius of the circle

Returns:

  • (Circle)

    A new Circle instance



57
58
# File 'docstub/circle.rb', line 57

def self.Circle(position, radius)
end

#color_blackColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



245
246
# File 'docstub/color.rb', line 245

def self.color_black
end

#color_blueColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



269
270
# File 'docstub/color.rb', line 269

def self.color_blue
end

#color_clearColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



239
240
# File 'docstub/color.rb', line 239

def self.color_clear
end

#color_cyanColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



281
282
# File 'docstub/color.rb', line 281

def self.color_cyan
end

#color_greenColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



263
264
# File 'docstub/color.rb', line 263

def self.color_green
end

#color_greyColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



293
294
# File 'docstub/color.rb', line 293

def self.color_grey
end

#color_hexColor

Returns A new Color instance.

Parameters:

  • hex (Integer)

    Hexadecimal color value (e.g., 0xFF0000 for red)

Returns:

  • (Color)

    A new Color instance



233
234
# File 'docstub/color.rb', line 233

def self.color_hex(hex)
end

#color_magentaColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



287
288
# File 'docstub/color.rb', line 287

def self.color_magenta
end

#color_redColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



257
258
# File 'docstub/color.rb', line 257

def self.color_red
end

#color_whiteColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



251
252
# File 'docstub/color.rb', line 251

def self.color_white
end

#color_yellowColor

Returns A new Color instance.

Returns:

  • (Color)

    A new Color instance



275
276
# File 'docstub/color.rb', line 275

def self.color_yellow
end

#pixel_hexPixel

Returns A new Pixel instance.

Parameters:

  • hex (Integer)

    Hexadecimal color value

Returns:

  • (Pixel)

    A new Pixel instance



319
320
# File 'docstub/color.rb', line 319

def self.pixel_hex(hex)
end

#pixel_rgbPixel

Returns A new Pixel instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

Returns:

  • (Pixel)

    A new Pixel instance



302
303
# File 'docstub/color.rb', line 302

def self.pixel_rgb(r, g, b)
end

#pixel_rgbaPixel

Returns A new Pixel instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

  • a (Integer)

    Alpha component (0 to 255)

Returns:

  • (Pixel)

    A new Pixel instance



312
313
# File 'docstub/color.rb', line 312

def self.pixel_rgba(r, g, b, a)
end

#rgbColor

Returns A new Color instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

Returns:

  • (Color)

    A new Color instance



216
217
# File 'docstub/color.rb', line 216

def self.rgb(r, g, b)
end

#rgb_fColor

Returns A new Color instance.

Parameters:

  • r (Float)

    Red component (0.0 to 1.0)

  • g (Float)

    Green component (0.0 to 1.0)

  • b (Float)

    Blue component (0.0 to 1.0)

Returns:

  • (Color)

    A new Color instance



197
198
# File 'docstub/color.rb', line 197

def self.rgb_f(r, g, b)
end

#rgbaColor

Returns A new Color instance.

Parameters:

  • r (Integer)

    Red component (0 to 255)

  • g (Integer)

    Green component (0 to 255)

  • b (Integer)

    Blue component (0 to 255)

  • a (Integer)

    Alpha component (0 to 255)

Returns:

  • (Color)

    A new Color instance



226
227
# File 'docstub/color.rb', line 226

def self.rgba(r, g, b, a)
end

#rgba_fColor

Returns A new Color instance.

Parameters:

  • r (Float)

    Red component (0.0 to 1.0)

  • g (Float)

    Green component (0.0 to 1.0)

  • b (Float)

    Blue component (0.0 to 1.0)

  • a (Float)

    Alpha component (0.0 to 1.0)

Returns:

  • (Color)

    A new Color instance



207
208
# File 'docstub/color.rb', line 207

def self.rgba_f(r, g, b, a)
end