SetObjectMaterialText函数

From SA-MP Wiki

Jump to: navigation, search


Description:

将文字嵌入进物件的相关函数,[0.3E新增功能].


Parameters:
(objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0)
objectid你想要嵌入文字的物件ID.
text你想显示在物件的文字.
materialindex文本的材料指数.
materialsize设置材料 大小.
fontface设置字体.
fontsize设置字体 (MAX 255).
bold设置加粗选项, 1 为加粗, 0 为不加粗.
fontcolor输入 ARGB格式的字体前景色.
backcolor输入 ARGB格式的字体背景色.
textalignment设置字体文本 对齐格式 (默认为左).


Return Values:

This function does not return any specific values.


if (strcmp("/text", cmdtext, true) == 0)
{
	new myobject = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); //物件名称
	SetObjectMaterialText(myobject, "SA-MP {FFFFFF}0.3{008500}e {FF8200}RC7", 0, OBJECT_MATERIAL_SIZE_256x128,\
	"Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
	// 物件里将会显示 "SA-MP 0.3e RC7" , 字体前景色为橙色,背景色为黑色
	return 1;
}
Image:32px-Ambox_warning_orange.png

Note

Color embedding 可以使用字体颜色嵌入.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
Navigation
Toolbox