GMTextView:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMTextView
ExtensionExtension

A simple text view for creating graphical interfaces

Description

GMTextView is a View that displays text.

It only allows for centered text. You can specify the text orientation. It will automatically resize when its container is resized.

Class Methods

.new

Creates a new instance of GMTextView.

Its graphical properties are defined by its associated GMStyle. By default, its borders are hidden. Use .displayBorder_(true) to modify this property.

Returns:

a GMTextView instance.

Instance Methods

.string

Sets or gets the displayed text, and refreshes the View.

.orientation

Sets or gets the displayed text orientation, and refreshes the View. Valid values are : \right, \top, \left or \bottom.

.fontRatio

Sets or gets the widget displayed text ratio, relative to the smallest axis of the widget, and refreshes the View. You'll need to reduce this value if the displayed text is larger than the size of the widget.

Please note that this modifies the font ratio itsel, not the ratio of the displayed string. As such, you might want to divide this value if you are displaying multiple text lines.

.maxFontSize

Sets or gets the widget maximum font height, expressed in pixels.

Internal Methods

.draw

The function associated to the View's drawFunc. Shouldn't be modified.

Examples

You can use .displayFrame_(true) to render the GMStyle frame :