Preskoči na vsebino

GetObjectMaterialText

opozorilo

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

Description

Get the material text data from an index of the object.

NameDescription
objectidThe ID of the object.
materialIndexThe material index on the object. (0 to 15)
text[]An array into which to store the text, passed by reference.
textSizeThe size of the text.
&OBJECT_MATERIAL_SIZE:materialSizeA variable in which to store the materialSize, passed by reference.
fontFace[]An array into which to store the fontFace, passed by reference.
fontFaceSizeThe size of the fontFace.
&fontSizeA variable in which to store the fontSize, passed by reference.
&bool:boldA boolean variable in which to store the bold, passed by reference.
&fontColourA variable in which to store the fontColour, passed by reference.
&backgroundColourA variable in which to store the backgroundColour, passed by reference.
&OBJECT_MATERIAL_TEXT_ALIGN:textAlignmentA variable in which to store the textAlignment, passed by reference.

Returns

true - The function was executed successfully.

false - The function failed to execute. The object specified does not exist or an invalid material index is specified.

Examples

new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220,   0.00000, 0.00000, 186.00000);
SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT);

new
text[16],
OBJECT_MATERIAL_SIZE:materialSize,
fontFace[16],
fontSize,
bool:bold,
fontColour,
backgroundColour,
OBJECT_MATERIAL_TEXT_ALIGN:textAlignment;

GetObjectMaterialText(objectid, 0, text, sizeof(text), materialSize, fontFace, sizeof(fontFace), fontSize, bold, fontColour, backgroundColour, textAlignment);
// text = "OPEN.MP"
// materialSize = OBJECT_MATERIAL_SIZE_256x128
// fontFace = "Arial"
// fontSize = 38
// bold = true
// fontColour = 0xFF0000FF
// backgroundColour = 0x00000000
// textAlignment = OBJECT_MATERIAL_TEXT_ALIGN_LEFT