|
*** very useful
Similar to STATE_object_create_from_text() only that it adds the text to a given object
This function is very useful to add labels to objects since the text will stick to the object
and follow it wherever it moves(a plane , a man walking etc ...)
Maybe a proper name would be STATE_object_set_text() since the function doesn't add text but rather
replace the current text with the given one (by default there is no text)
This function adds two parameters that are not included in STATE_object_create_from_text()
The size parameter is used to control the size of the text without effecting the object size
As would happen if were to use STATE_object_set_scale() (this will increase the size of both the text and the rest of the object)
The offset parameter is used to control the location of the text relative to the location of the object (in object space coords)
Parameters:
object_handle:
A handle to an object to which we want to add the text
font_handle, text, red, green, blue
See explanations in STATE_object_create_from_text()
flags:
As in STATE_object_create_from_text() only that here the flag CREATE_3D_TEXT has no effect
size:
The size parameter is used to control the size of the text without effecting the object size
As would happen if were to use STATE_object_set_scale() (this will increase the size of both the text and the rest of the object)
offset:
The offset parameter is used to control the location of the text relative to the location of the object (in object space coords)
See also:
STATE_object_get_text(), STATE_object_create_from_text()
Example:
double text_offset[3]={0, 0, 0};
STATE_object_add_text(obj, ariel14, "Against All Odds", 255, 100, 32, FONT_WRITE_CENTERED_X | FONT_WRITE_CENTERED_Y , 1000, text_offset);
|