本文整理汇总了C++中Text::DisplayText方法的典型用法代码示例。如果您正苦于以下问题:C++ Text::DisplayText方法的具体用法?C++ Text::DisplayText怎么用?C++ Text::DisplayText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::DisplayText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
//.........这里部分代码省略.........
{
// If there are Window messages then process them.
if(PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
// Otherwise, do animation/game stuff.
else
{
switch(gameState)
{
case (1)://menu state
/*
TO DO IN CASE 1
setup menu with UI and Graphics
update
render
loop till user input to change gamestate
*/
//DO SOMETHING HERE
pD3DDevice->BeginScene();
pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0) , 1.0f, 0);
GetClientRect(hWnd, &rect);
sprintf(str, "Engine Demo");
pFont->DrawText(NULL, str, -1, &rect,
DT_TOP | DT_CENTER | DT_NOCLIP , D3DCOLOR_ARGB(255,
255,
255,
255
));
gText.DisplayText("Play Demo - (1)", width / 2, height * 0.25f, 50, 25, WHITE);
gText.DisplayText("Credits - (2)", width / 2, height * 0.5f, 50, 25, WHITE);
gText.DisplayText("Exit Demo - (3)", width / 2, height * 0.75f, 50, 25, WHITE);
pD3DDevice->EndScene();
pD3DDevice->Present(0, 0, 0, 0);
main_core->Update(enemy, gameState);
if(input_core->OnePressed())
{
gameState = 2;
}
if(input_core->TwoPressed())
{
gameState = 3;
}
if(input_core->ThreePressed())
{
gameState = 4;
}
break;
case (2)://game logic state
float temp[3];
float temp2[3];
player->agentData.getPosition(temp);
if(temp[1] <= 101)
jump = false;
if(input_core->EscPressed()) gameState = 1;
if(input_core->APressed())
{
示例2: SetText
void SetText(char* string, int x, int y, int width, int height, D3DXCOLOR color) {
text->DisplayText(string, x, y, width, height, color);
}