跳到主要内容

PlayerTextDrawGetLetterSize

注意

这个函数是在omp v1.1.0.2612中添加的,在以前的版本中不起作用!

描述

获取文本字符的宽度和高度

参数名说明
playerid玩家的 ID
PlayerText:textid要获取字符尺寸的玩家文本绘图的 ID
&Float:width用于存储宽度的浮点变量,通过引用传递
&Float:height用于存储高度的浮点变量,通过引用传递

返回值

该函数不返回特定值。

示例

new PlayerText:welcomeText[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server");
PlayerTextDrawLetterSize(playerid, welcomeText[playerid], 3.2, 5.1);
PlayerTextDrawShow(playerid, welcomeText[playerid]);

new Float:width, Float:height;
PlayerTextDrawGetLetterSize(playerid, welcomeText[playerid], width, height);
// width = 3.2
// height = 5.1
return 1;
}

相关函数