#pragma once
#include "stdafx.h"
#include "FONT.h"

FONT::FONT(LPDIRECT3DDEVICE9 pDevice,int Height,int Width,LPCWSTR TypeFont)
{
	hFont = CreateFont(Height,Width,0,0,FW_NORMAL,FALSE,FALSE,0,1,0,0,0,DEFAULT_PITCH | FF_MODERN,TypeFont);

	Rec.bottom	=100;
	Rec.left	=0;
	Rec.right	=100;
	Rec.top		=0;

	Color		= D3DCOLOR_ARGB(255,255,255,255);

	D3DXCreateFont(pDevice,hFont,&pFont);
	Text = new wchar_t[16] ;
		
}



void	FONT::Draw(char* String)
{
	pFont->Begin();
	pFont->DrawTextA(String,-1,&Rec,DT_WORDBREAK||DT_CENTER,Color);
	pFont->End();

}



void	FONT::Draw(int String)
{
	wsprintf(Text,L"%d",String);
	pFont->Begin();
	pFont->DrawText(Text,-1,&Rec,DT_WORDBREAK||DT_CENTER,Color);
	pFont->End();

}



FONT::~FONT(void)
{
	delete Text;
	pFont->Release();
};

