TextCreateTextItem: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
  [[textitem]] textCreateTextItem ( [text, x, y, priority, red, green, blue, alpha, scale] )
  [[textitem]] textCreateTextItem ( [text, x, y, priority, red, green, blue, alpha, scale] )


text: The text you want to be displayed initially.<br />
'''text''': The text you want to be displayed initially.<br />
x: A floating point number between 0.0 and 1.0 indicating how far across the screen the text should be shown, as a percentage of the width, from the left hand side.<br />
'''x''': A floating point number between 0.0 and 1.0 indicating how far across the screen the text should be shown, as a percentage of the width, from the left hand side.<br />
y: A floating point number between 0.0 and 1.0 indicating how far down the screen the text should be shown, as a percentage of the height, from the top.<br />
'''y''': A floating point number between 0.0 and 1.0 indicating how far down the screen the text should be shown, as a percentage of the height, from the top.<br />
priority: How important it is that this text should be up to date on client's screens. Valid values are: "low", "medium", "high" which are aliases for 0, 1 and 2 respectively.<br />
priority: How important it is that this text should be up to date on client's screens. Valid values are: "low", "medium", "high" which are aliases for 0, 1 and 2 respectively.<br />
red: A value between 0 and 255 indicating how red the text should be.<br />
'''red''': A value between 0 and 255 indicating how red the text should be.<br />
green: A value between 0 and 255 indicating how green the text should be.<br />
'''green''': A value between 0 and 255 indicating how green the text should be.<br />
blue: A value between 0 and 255 indicating how blue the text should be.<br />
'''blue''': A value between 0 and 255 indicating how blue the text should be.<br />
alpha: A value between 0 and 255 indicating how transparent the text should be, with 0 being fully transparent, and 255 being opaque.<br />
'''alpha''': A value between 0 and 255 indicating how transparent the text should be, with 0 being fully transparent, and 255 being opaque.<br />
scale: A floating point value indicating the scale of the text. The default is 1.0, which is around 12pt.<br />
'''scale''': A floating point value indicating the scale of the text. The default is 1.0, which is around 12pt.<br />


All parameters are optional.
All parameters are optional.

Revision as of 20:00, 23 March 2006

Description

This function creates a text item. A text item represents a single area of text, much like a label does in standard GUI programing. A text item can only be seen by players if it is added to a textdisplay using textDisplayAddText.

Syntax

textitem textCreateTextItem ( [text, x, y, priority, red, green, blue, alpha, scale] )

text: The text you want to be displayed initially.
x: A floating point number between 0.0 and 1.0 indicating how far across the screen the text should be shown, as a percentage of the width, from the left hand side.
y: A floating point number between 0.0 and 1.0 indicating how far down the screen the text should be shown, as a percentage of the height, from the top.
priority: How important it is that this text should be up to date on client's screens. Valid values are: "low", "medium", "high" which are aliases for 0, 1 and 2 respectively.
red: A value between 0 and 255 indicating how red the text should be.
green: A value between 0 and 255 indicating how green the text should be.
blue: A value between 0 and 255 indicating how blue the text should be.
alpha: A value between 0 and 255 indicating how transparent the text should be, with 0 being fully transparent, and 255 being opaque.
scale: A floating point value indicating the scale of the text. The default is 1.0, which is around 12pt.

All parameters are optional.

Example

textDisplay = textCreateDisplay ();
textItem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 );
textDisplayAddText ( textDisplay, textItem );