?? perimenu.cpp
字號:
#include "perimenu.h"
PeriMenu::PeriMenu()
{
}
PeriMenu::~PeriMenu()
{
}
ID3DXFont *font=NULL;
BOOL PeriMenu::ShowPMenu()
{
TexSurface.Blt(&BJ,NULL,GESUR_INTERIOR);
font->DrawText(
Menu1, // String to draw.
-1, // Null terminating string.
&rectm1, // Rectangle to draw the string in.
DT_TOP | DT_LEFT, // Draw in top-left corner of rect.
D3DCOLOR_XRGB(255,255,255)); // Black.
font->DrawText(
Menu2, // String to draw.
-1, // Null terminating string.
&rectm2, // Rectangle to draw the string in.
DT_TOP | DT_LEFT, // Draw in top-left corner of rect.
D3DCOLOR_XRGB(255,255,255)); // Black.
return TRUE;
}
BOOL PeriMenu::InitPMenu(LPDIRECT3DDEVICE8 &g_pD3DDevice)
{
rectm1.bottom = 280;
rectm1.left = 380;
rectm1.right = 530;
rectm1.top = 200;
rectm2.bottom = 400;
rectm2.left = 380;
rectm2.right = 530;
rectm2.top = 340;
rectsm1.bottom = 400;
rectsm1.left = 380;
rectsm1.right = 530;
rectsm1.top = 340;
rectip.bottom = 280;
rectip.left = 180;
rectip.right = 630;
rectip.top = 200;
BJ.bottom = 640;
BJ.left = 0;
BJ.right = 800;
BJ.top = 0;
LOGFONT lf;
ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfHeight = 21; // in logical units
lf.lfWidth = 13; // in logical units
lf.lfWeight = 500; // boldness, range 0(light) - 1000(bold)
lf.lfItalic = FALSE;
lf.lfUnderline = FALSE;
lf.lfStrikeOut = FALSE;
lf.lfCharSet = DEFAULT_CHARSET;
strcpy(lf.lfFaceName, "Times New Roman"); // font style
D3DXCreateFontIndirect(g_pD3DDevice, &lf, &font);
TexSurface.CreFileToTex(g_pD3DDevice,"background.bmp",
0,D3DFMT_A1R5G5B5,GESYSMEM,0xff000000);
return TRUE;
}
int PeriMenu::PtInRectPMenu(int x, int y)
{
POINT pt;
pt.x = x;
pt.y = y;
if (PtInRect(&rectm1,pt))
return 1;
else if(PtInRect(&rectm2,pt))
return 2;
return 0;
}
BOOL PeriMenu::ShowServerPMenu()
{
TexSurface.Blt(&BJ,NULL,GESUR_INTERIOR);
font->DrawText(
ServerMenu1, // String to draw.
-1, // Null terminating string.
&rectsm1, // Rectangle to draw the string in.
DT_TOP | DT_LEFT, // Draw in top-left corner of rect.
0xffff0000); // Black.
font->DrawText(
ip, // String to draw.
-1, // Null terminating string.
&rectip, // Rectangle to draw the string in.
DT_TOP | DT_LEFT, // Draw in top-left corner of rect.
0xffff00ff); // Black.
return TRUE;
}
void PeriMenu::SetIp(TCHAR *IP)
{
sprintf(ip,"你的主機IP為:%s",IP);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -