用drawIcon3D:
.....
drawIcon3D[addons_ROOT + "\icons\targetWest.jpg", [1,1,1,0.5], _unitPos, _iSize, _iSize, 0, _text];//要连续显示最好用帧循环来执行
....
用cutRsc hud显示方式:
....
1 cutRsc ["namehud","PLAIN"];
_pos=worldToScreen [getPosATL _unit select 0,getPosATL _unit select 1,(getPosATL _unit select 2)+(_unit selectionPosition "launcher" select 2)+0.65];
if (count _pos>0) then {
_hud=_ui displayCtrl (23501+_index);
_hud ctrlSetPosition [(_pos select 0)-0.2,_pos select 1];
_hud ctrlSetText (if (!visibleMap) then {name _unit} else {""});
_hud ctrlSetTextColor [_textColor select 0, _textColor select 1, _textColor select 2 ,0.8 min (1.2 - _dist * (1 / _displayDistance))];
_hud ctrlCommit 0;
_index = _index + 1;
};
......
drawIcon3D除了代码简洁优势外它们各有什么优缺点{:soso_e132:} ,我用的是drawIcon3D离单位远了文字都会下降直到地面。 |