My Project
SpriteFontEntityDirectX.h
1 #pragma once
2 #include "SpriteFontEntity.h"
3 
4 namespace ParaEngine
5 {
7  {
8  private:
9  ID3DXSprite* m_pD3DXSprite;
10 
12  union _FontAttribute
13  {
14  struct _fontGDI
15  {
16  LPD3DXFONT m_pFont;
17  }GDIFont;
18 
19  struct _fontBitmap
20  {
27  LPDIRECT3DTEXTURE9 m_pTexture;
28  }BMPFont;
29  }FontAttibute;
30 
31 
32  public:
33  virtual AssetEntity::AssetType GetType(){ return AssetEntity::font; };
36  {
41  }TextureType;
42 
43  public:
46 
47  virtual ~SpriteFontEntityDirectX();
48 
49  virtual HRESULT InitDeviceObjects();
50  virtual HRESULT RestoreDeviceObjects();
51  virtual HRESULT InvalidateDeviceObjects();
52  virtual HRESULT DeleteDeviceObjects();
53 
54  ID3DXSprite* GetFontSprite();
55  LPD3DXFONT GetFont();
56 
57  virtual HRESULT DrawTextA(CSpriteRenderer* pSprite, const char* strText, int nCount, RECT* rect, DWORD dwTextFormat, DWORD textColor);
58 
59  virtual HRESULT DrawTextW(CSpriteRenderer* pSprite, const char16_t* strText, int nCount, RECT* rect, DWORD dwTextFormat, DWORD textColor);
60 
61  };
62 }
int m_nCharsPerLine
Number of characters per line in the image.
Definition: SpriteFontEntityDirectX.h:22
AssetType
each asset type has a unique asset type number
Definition: AssetEntity.h:82
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ManagedDef.h:18
font from self-supplied bitmap file
Definition: SpriteFontEntityDirectX.h:40
int m_nLetterHeight
Height of each letter.
Definition: SpriteFontEntityDirectX.h:24
Definition: SpriteFontEntityDirectX.h:6
int m_nLetterWidth
Width of each letter.
Definition: SpriteFontEntityDirectX.h:26
GDI font, can be trueType.
Definition: SpriteFontEntityDirectX.h:38
std::string AssetKey
the unique key object for asset entity.
Definition: AssetEntity.h:13
_FontTextureType
how font texture is created
Definition: SpriteFontEntityDirectX.h:35
base class for sprite renderer
Definition: SpriteRenderer.h:55
Definition: SpriteFontEntity.h:26