Ejemplo n.º 1
0
void CGameFont::MasterOut(
	BOOL bCheckDevice , BOOL bUseCoords , BOOL bScaleCoords , BOOL bUseSkip , 
	float _x , float _y , float _skip , LPCSTR fmt , va_list p )
{
	if ( bCheckDevice && ( ! Device.b_is_Active ) )
		return;

	String rs;

	rs.x = ( bUseCoords ? ( bScaleCoords ? ( DI2PX( _x ) ) : _x ) : fCurrentX );
	rs.y = ( bUseCoords ? ( bScaleCoords ? ( DI2PY( _y ) ) : _y ) : fCurrentY );
	rs.c = dwCurrentColor;
	rs.height = fCurrentHeight;
	rs.align = eCurrentAlignment;

	int vs_sz = vsprintf_s( rs.string , fmt , p );

	//VERIFY( ( vs_sz != -1 ) && ( rs.string[ vs_sz ] == '\0' ) );

	rs.string[ sizeof(rs.string)-1 ] = 0;
	if ( vs_sz == -1 )
	{
		return;
	}

	if ( vs_sz )
		strings.push_back( rs );

	if ( bUseSkip )
		OutSkip( _skip );
}
Ejemplo n.º 2
0
void CUIGameAHunt::Init	()
{
	CUIXml xml_doc;
	bool xml_result = xml_doc.Init(CONFIG_PATH, UI_PATH, "stats.xml");
	R_ASSERT2(xml_result, "xml file not found");

	CUIFrags2* pFragList		= xr_new<CUIFrags2>();			pFragList->SetAutoDelete(true);
	//-----------------------------------------------------------
	CUIDMStatisticWnd* pStatisticWnd = xr_new<CUIDMStatisticWnd>(); pStatisticWnd->SetAutoDelete(true);

	pFragList->Init(xml_doc, "stats_wnd", "frag_wnd_tdm");

	float ScreenW = UI_BASE_WIDTH;
	float ScreenH = UI_BASE_HEIGHT;
	//-----------------------------------------------------------
	Frect FrameRect = pFragList->GetWndRect ();
	float FrameW	= FrameRect.right - FrameRect.left;
	float FrameH	= FrameRect.bottom - FrameRect.top;

	pFragList->SetWndPos((ScreenW-FrameW)/2.0f, (ScreenH - FrameH)/2.0f);

	//-----------------------------------------------------------
	m_pFragLists->AttachChild(pFragList);
	//-----------------------------------------------------------

	CUIFrags2* pPlayerListT1	= xr_new<CUIFrags2>	();pPlayerListT1->SetAutoDelete(true);

	pPlayerListT1->Init(xml_doc, "players_wnd", "frag_wnd_tdm");
	//-----------------------------------------------------------
	FrameRect = pPlayerListT1->GetWndRect ();
	FrameW	= FrameRect.right - FrameRect.left;
	FrameH	= FrameRect.bottom - FrameRect.top;

	pPlayerListT1->SetWndPos((ScreenW-FrameW)/2.0f, (ScreenH - FrameH)/2.0f);
	//-----------------------------------------------------------
	m_pPlayerLists->AttachChild(pPlayerListT1);
	//-----------------------------------------------------------

	m_todo_caption					=	"ah_todo";
	GameCaptions()->addCustomMessage(m_todo_caption, 0.0f, -0.8f, 0.02f, HUD().Font().pFontGraffiti19Russian, CGameFont::alCenter, TODO_MSG_COLOR, "");
	GameCaptions()->customizeMessage(m_todo_caption, CUITextBanner::tbsFlicker)->fPeriod = 0.5f;

	m_buy_msg_caption				=	"ah_buy";
	GameCaptions()->addCustomMessage(m_buy_msg_caption, DI2PX(0.0f), DI2PY(0.9f), SZ(0.02f), HUD().Font().pFontGraffiti19Russian, CGameFont::alCenter, BUY_MSG_COLOR, "");
	//-----------------------------------------------------------
	FrameRect = pStatisticWnd->GetFrameRect ();
	FrameW	= FrameRect.right - FrameRect.left;
	FrameH	= FrameRect.bottom - FrameRect.top;
	pStatisticWnd->SetWndRect((ScreenW-FrameW)/2.0f, (ScreenH - FrameH)/2.0f, FrameW, FrameH);

	m_pStatisticWnds->AttachChild(pStatisticWnd);

};
Ejemplo n.º 3
0
void __cdecl CGameFont::OutI(float _x, float _y, LPCSTR fmt,...)
{
//	if (!Device.bActive)	return;
	String		rs;
	rs.x		=DI2PX(_x);
	rs.y		=DI2PY(_y);
	rs.c		=dwCurrentColor;
	rs.height		=fCurrentHeight;
	rs.align	=eCurrentAlignment;

	va_list		 p;
	va_start	(p,fmt);
	int vs_sz	= _vsnprintf(rs.string,sizeof(rs.string)-1,fmt,p); rs.string[sizeof(rs.string)-1]=0;
	va_end		(p);
	if (vs_sz)	strings.push_back(rs);

}
Ejemplo n.º 4
0
void CGameFont::OutSetI			(float x, float y)
{
	OutSet(DI2PX(x),DI2PY(y));
}