just look at other menu sources or something, this should work:
drawing text:
Code:
//top of your project:
LPD3DXFONT Directx_Font;
VOID DrawText(LPDIRECT3DDEVICE9 Device, INT x, INT y, DWORD color, CHAR *text)
{
RECT rect;
SetRect(&rect, x, y, x + 100, y);
Directx_Font->DrawText(NULL, text, -1, &rect, DT_CENTER | DT_NOCLIP, color);
}
//in endscene:
if (Directx_Font == NULL)
D3DXCreateFontA(Device, 14, 0, FW_BOLD, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Directx_Font);
if (Directx_Font)
DrawText(Device, 10, 10, D3DCOLOR_ARGB(255, 255, 255, 249), "Hello world!");
//in reset:
if (Directx_Font)
Directx_Font->OnLostDevice();
HRESULT iReturnValue = OrigReset(Device, Params);
if (iReturnValue == D3D_OK)
{
if (Directx_Font)
Directx_Font->OnResetDevice();
}
drawing sprites:
Code:
bool SpriteCreated0 = NULL;
LPDIRECT3DTEXTURE9 IMAGE0;
LPD3DXSPRITE SPRITE0;
D3DXVECTOR3 ImagePos0;
//in endscene:
if (SpriteCreated0 == FALSE)
{
D3DXCreateTextureFromFile(Device, "yourpng.png", &IMAGE0); //place png in game dir
SpriteCreated0 = TRUE;
}
D3DXCreateSprite(Device, &SPRITE0);
ImagePos0.x = 100; //(int)ModelInfo[i]->Position2D.x;
ImagePos0.y = 100 //(int)ModelInfo[i]->Position2D.y;
ImagePos0.z = 0.0f;
SPRITE0->Begin(D3DXSPRITE_ALPHABLEND);
SPRITE0->Draw(IMAGE0, NULL, NULL, &ImagePos0, 0xFFFFFFFF);
SPRITE0->End();
if (SPRITE0 != NULL){SPRITE0->Release();}SPRITE0 = NULL ;