?? directxfont.h
字號:
// DirectXFont.h
//
// Author: Lea Hayes
// Date Created: 13/03/2006
// Date Modified: 13/03/2006
// Description:
// Opens and manipulates font.
//
#pragma once
#include "IResource.h"
class DirectXFont : public Resources::IResource
{
// Enumerations.
public:
enum DrawFormat
{
TopAlign = DT_TOP,
LeftAlign = DT_LEFT,
CentreAlign = DT_CENTER,
RightAlign = DT_RIGHT,
VCentreAlign = DT_VCENTER,
BottomAlign = DT_BOTTOM,
WorkBreak = DT_WORDBREAK,
SingleLine = DT_SINGLELINE,
ExpandTabs = DT_EXPANDTABS,
NoClipping = DT_NOCLIP,
CalculateRect = DT_CALCRECT,
RightToLeft = DT_RTLREADING
};
// Construction and destruction.
public:
DirectXFont();
DirectXFont(LPCSTR lpszFontName, INT nHeight, UINT nWidth,
bool bBold, bool bItalic, UINT nMipLevels, LPCSTR lpszTypeFace);
virtual ~DirectXFont();
HRESULT SetFont(LPCSTR lpszFontName, INT nHeight, UINT nWidth,
bool bBold, bool bItalic, UINT nMipLevels, LPCSTR lpszTypeFace);
// Pure virtual functions which must be overriden.
virtual void OnProcess(float nTime) {}
virtual void OnRender(float nTime) {}
void DrawText(LPD3DXSPRITE pSurface, LPCSTR lpszText, int nLength,
RECT &rtRectOut, DWORD dwFormat, D3DCOLOR rgbColour);
virtual DWORD GetUniqueID() const;
// Virtual functions which can be overriden.
virtual void OnDestroy();
// Properties.
public:
inline LPD3DXFONT GetFont()
{
return m_pFont;
}
protected:
void CleanUp();
// Attributes.
private:
LPD3DXFONT m_pFont; // Font itself.
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -