Пример #1
0
	bool __declspec(dllexport) SetupGameIcon(u32 icon, u32 cl, float width, float height) // позволяет расцветить иконку или изменить её размер
	{
		CUIMainIngameWnd *window = GetMainIngameWindow();
		if (!window)
		{
			log_script_error("SetupGameIcon failed due GetMainIngameWindow() returned NULL");
			return false;
		}


		CUIStatic *sIcon = warn_icon_list[icon & 7];
		
		if (sIcon)
		{			
			if (width > 0 && height > 0)
			{
				sIcon->SetWidth (width);
				sIcon->SetHeight (height);
				sIcon->SetStretchTexture(cl > 0);
			}
			else 
				window->SetWarningIconColor((CUIMainIngameWnd::EWarningIcons)icon, cl);

			external_icon_ctrl = true;
			return true;
		}
		return false;
	}
Пример #2
0
float CUIPdaKillMessage::InitText(CUIStatic& refStatic, float x, PlayerInfo& info)
{

	if ( 0 == xr_strlen(info.m_name))
		return 0.0f;

	CGameFont* pFont					= GetFont();
	float _eps							= pFont->SizeOf_(' ');
	UI()->ClientToScreenScaledWidth		(_eps); //add one letter

	float height						= pFont->CurrentHeight_();
	float y								= (GetHeight() - height)/2;

	refStatic.SetWndPos					(Fvector2().set(x, y));
	refStatic.SetHeight					(GetHeight());
	refStatic.SetEllipsis				(1, 0);
	refStatic.SetText					(info.m_name.c_str());
	refStatic.AdjustWidthToText			();
	refStatic.SetWidth					(refStatic.GetWidth()+_eps);
	refStatic.SetTextColor				(info.m_color);

	return		refStatic.GetWidth		();
}