String Formatting of Types

Within OpenGUI there are several object types that can be converted to and from strings. The purpose of this document is to provide documentation for the string representation of these objects.

Throughout OpenGUI, all string readable and writable objects are converted through the StrConv class. The following is a guide to the input that StrConv expects, as well as what you can expect the output of StrConv to look like.

Note:
Whitespace is present in many of the string formats. This whitespace is optional. The presence or lack of whitespace should not affect processing. All other non-base type decorations such as
{ } ( ) x X # @ | :
are used for structure verification and delimiting, and are required.

int


float


bool

Valid values for reading bool are "true", "false", "1", and "0". When writing, the "true" and "false" values are always used. Case is ignored.


IVector2

General format:
( int_x x int_y )

The parenthesis are required, and the "x" is used as a delimiter between the 2 integers. The case of the x is significant.


IRect

General format:
{ ( int_min_x x int_min_y ) X ( int_max_x x int_max_y ) }

The {, }, (, ), x, and X are required. The case of X and x is significant. This is best thought of as two IVector2's separated by an X, enclosed in surrounding curly braces.


FVector2

General format:
( float_x x float_y )

The parenthesis are required, and the "x" is used as a delimiter between the 2 floats. The case of the x is significant.


FRect

General format:
{ ( float_min_x x float_min_y ) X ( float_max_x x float_max_y ) }

The {, }, (, ), x, and X are required. The case of X and x is significant. This is best thought of as two FVector2's separated by an X, enclosed in surrounding curly braces.


Color

General format:
float_red : float_green : float_blue : float_alpha

The :'s are used as delimiters between the float values and are required. The values of the floats can be any positive or negative value, though generally you would want to use positive values between 0.0f and 1.0f for each component.


Font

General format:
font_name @ font_size

The font_name and font_size are sent directly to the Font() constructor.


TextAlignment

General format:
horizontal_alignment | vertical_alignment

Horizontal alignment must be one of:

Vertical alignment must be one of:

Case is irrelevant, but watch your spelling.


Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Fri Jan 5 23:05:24 2007