Class: LiteRGSS::Text

Inherits:
Drawable show all
Defined in:
LiteRGSS.rb.yard.rb,
docs/00700_Ajout_PSDK.rb

Overview

Note:

Text cannot be saved, loaded from file nor cloned in the memory

Class that describes a text shown on the screen or inside a viewport

Direct Known Subclasses

Text

Defined Under Namespace

Modules: Util

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Disposable

#dispose, #disposed?

Instance Attribute Details

#__index__Integer (readonly)

Return the text index to know if it has been created before an other sprite/text/viewport in the same viewport

Returns:

  • (Integer)

    Return the text index to know if it has been created before an other sprite/text/viewport in the same viewport



471
472
473
# File 'LiteRGSS.rb.yard.rb', line 471

def __index__
  @__index__
end

#alignInteger

Returns The alignment of the text (0 = left, 1 = center, 2 = right).

Returns:

  • (Integer)

    The alignment of the text (0 = left, 1 = center, 2 = right)



439
440
441
# File 'LiteRGSS.rb.yard.rb', line 439

def align
  @align
end

#boldBoolean

Returns If the text should be shown in bold.

Returns:

  • (Boolean)

    If the text should be shown in bold



477
478
479
# File 'LiteRGSS.rb.yard.rb', line 477

def bold
  @bold
end

#draw_shadowBoolean

Returns If the text is drawn as in Pokemon DPP / RSE / HGSS / BW (with shadow).

Returns:

  • (Boolean)

    If the text is drawn as in Pokemon DPP / RSE / HGSS / BW (with shadow)



455
456
457
# File 'LiteRGSS.rb.yard.rb', line 455

def draw_shadow
  @draw_shadow
end

#fill_colorColor

Returns The inside color of the text.

Returns:

  • (Color)

    The inside color of the text



441
442
443
# File 'LiteRGSS.rb.yard.rb', line 441

def fill_color
  @fill_color
end

#heightNumeric

Returns The height of the text surface.

Returns:

  • (Numeric)

    The height of the text surface



433
434
435
# File 'LiteRGSS.rb.yard.rb', line 433

def height
  @height
end

#italicBoolean

Returns If the text should be shown in italic.

Returns:

  • (Boolean)

    If the text should be shown in italic



475
476
477
# File 'LiteRGSS.rb.yard.rb', line 475

def italic
  @italic
end

#nchar_drawInteger

Returns The number of character the object should draw.

Returns:

  • (Integer)

    The number of character the object should draw



457
458
459
# File 'LiteRGSS.rb.yard.rb', line 457

def nchar_draw
  @nchar_draw
end

#opacityInteger

Returns Opacity of the text.

Returns:

  • (Integer)

    Opacity of the text



461
462
463
# File 'LiteRGSS.rb.yard.rb', line 461

def opacity
  @opacity
end

#outline_colorColor

Returns The color of the outline.

Returns:

  • (Color)

    The color of the outline



443
444
445
# File 'LiteRGSS.rb.yard.rb', line 443

def outline_color
  @outline_color
end

#outline_thicknessInteger

Returns The size of the text outline.

Returns:

  • (Integer)

    The size of the text outline



435
436
437
# File 'LiteRGSS.rb.yard.rb', line 435

def outline_thickness
  @outline_thickness
end

#real_widthInteger (readonly)

Return the real width of the text

Returns:

  • (Integer)

    Return the real width of the text



459
460
461
# File 'LiteRGSS.rb.yard.rb', line 459

def real_width
  @real_width
end

#sizeInteger

Returns The font size of the text.

Returns:

  • (Integer)

    The font size of the text



437
438
439
# File 'LiteRGSS.rb.yard.rb', line 437

def size
  @size
end

#textString

Returns Text shown by this Object.

Returns:

  • (String)

    Text shown by this Object



451
452
453
# File 'LiteRGSS.rb.yard.rb', line 451

def text
  @text
end

#viewportViewport, Window (readonly)

Return the Text viewport

Returns:



473
474
475
# File 'LiteRGSS.rb.yard.rb', line 473

def viewport
  @viewport
end

#visibleBoolean

Returns If the Text is visible.

Returns:

  • (Boolean)

    If the Text is visible



453
454
455
# File 'LiteRGSS.rb.yard.rb', line 453

def visible
  @visible
end

#widthNumeric

Returns The width of the text surface.

Returns:

  • (Numeric)

    The width of the text surface



431
432
433
# File 'LiteRGSS.rb.yard.rb', line 431

def width
  @width
end

#xNumeric

Returns The x coordinate of the text surface.

Returns:

  • (Numeric)

    The x coordinate of the text surface



427
428
429
# File 'LiteRGSS.rb.yard.rb', line 427

def x
  @x
end

#yNumeric

Returns The y coordinate of the text surface.

Returns:

  • (Numeric)

    The y coordinate of the text surface



429
430
431
# File 'LiteRGSS.rb.yard.rb', line 429

def y
  @y
end

#zNumeric

Returns The Text z property.

Returns:

  • (Numeric)

    The Text z property



469
470
471
# File 'LiteRGSS.rb.yard.rb', line 469

def z
  @z
end

Class Method Details

.new(font_id, viewport, x, y, width, height, str, align = 0, outlinesize = nil, color_id = nil, size_id = nil)

Create a new Text

Parameters:

  • font_id (Integer)

    the id of the font to use to draw the text (loads the size and default colors from that)

  • viewport (Viewport, Window)

    the viewport in which the text is shown, can be a Window

  • x (Integer)

    the x coordinate of the text surface

  • y (Integer)

    the y coordinate of the text surface

  • width (Integer)

    the width of the text surface

  • height (Integer)

    the height of the text surface

  • str (String)

    the text shown by this object

  • align (0, 1, 2) (defaults to: 0)

    the align of the text in its surface (best effort => no resize), 0 = left, 1 = center, 2 = right

  • outlinesize (Integer, nil) (defaults to: nil)

    the size of the text outline

  • color_id (Integer, nil) (defaults to: nil)

    ID of the color took from Fonts

  • size_id (Integer, nil) (defaults to: nil)

    ID of the size took from Fonts



416
417
418
# File 'LiteRGSS.rb.yard.rb', line 416

def self.new(font_id, viewport, x, y, width, height, str, align = 0, outlinesize = nil, color_id = nil, size_id = nil)

end

Instance Method Details

#load_color(font_id) ⇒ self

Load a color from a font_id

Parameters:

  • font_id (Integer)

    id of the font where to load the colors

Returns:

  • (self)


447
448
449
# File 'LiteRGSS.rb.yard.rb', line 447

def load_color(font_id)

end

#multiline_text=(value)

Set a multiline text

Parameters:

  • value (String)

    Multiline text that should be ajusted to be display on multiple lines



456
457
# File 'docs/00700_Ajout_PSDK.rb', line 456

def multiline_text=(value)
end

#set_position(x, y) ⇒ self

Define the position of the text

Parameters:

  • x (Numeric)
  • y (Numeric)

Returns:

  • (self)


423
424
425
# File 'LiteRGSS.rb.yard.rb', line 423

def set_position(x, y)

end

#text_width(text) ⇒ Integer

Return the width of the given string if drawn by this Text object

Parameters:

Returns:

  • (Integer)


465
466
467
# File 'LiteRGSS.rb.yard.rb', line 465

def text_width(text)

end