Class: MG::Text

Inherits:
Widget show all
Defined in:
motion-game

Properties (collapse)

Attributes inherited from Widget

#enabled?, #highlighted?

Attributes inherited from Node

#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #visible?, #z_index

Constructors (collapse)

Methods inherited from Widget

#on_touch

Methods inherited from Node

#add, #children, #clear, #delete, #delete_from_parent, #intersects?, #parent

Constructor Details

- (Text) initialize(text = '', font = '', font_size = 0)

Creates a new Text widget with optional content, font name and size.

Parameters:

  • text (String) (defaults to: '')

    content for the text widget.

  • font (String) (defaults to: '')

    name of the font the text widget should use.

  • font_size (Integer) (defaults to: 0)

    size of the font the text widget should use.



707
# File 'motion-game', line 707

def initialize(text='', font='', font_size=0); end

Instance Attribute Details

- (Size) area_size

Returns the text rendering area size.

Returns:

  • (Size)

    the text rendering area size.



725
726
727
# File 'motion-game', line 725

def area_size
  @area_size
end

- (String) font

Returns name of the font used by the widget.

Returns:

  • (String)

    name of the font used by the widget.



719
720
721
# File 'motion-game', line 719

def font
  @font
end

- (Integer) font_size

Returns size of the font used by the widget.

Returns:

  • (Integer)

    size of the font used by the widget.



722
723
724
# File 'motion-game', line 722

def font_size
  @font_size
end

- (:left, ...) horizontal_align

Returns the horizontal alignment of the text.

Returns:

  • (:left, :center, :right)

    the horizontal alignment of the text.



731
732
733
# File 'motion-game', line 731

def horizontal_align
  @horizontal_align
end

- (String) text

Returns content of the widget.

Returns:

  • (String)

    content of the widget.



713
714
715
# File 'motion-game', line 713

def text
  @text
end

- (Color) text_color

Returns color of the text part of the widget.

Returns:

  • (Color)

    color of the text part of the widget.



716
717
718
# File 'motion-game', line 716

def text_color
  @text_color
end

- (:top, ...) vertical_align

Returns the vertical alignment of the text.

Returns:

  • (:top, :center, :bottom)

    the vertical alignment of the text.



728
729
730
# File 'motion-game', line 728

def vertical_align
  @vertical_align
end