mirror of
https://github.com/unknownworlds/NS.git
synced 2024-12-21 01:41:13 +00:00
5dcc163bd5
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@379 67975925-1194-0748-b3d5-c16f83f1a3a1
69 lines
No EOL
1.3 KiB
C++
69 lines
No EOL
1.3 KiB
C++
#ifndef AVH_FONT_H
|
|
#define AVH_FONT_H
|
|
|
|
#include "cl_dll/wrect.h"
|
|
#include "cl_dll/cl_dll.h"
|
|
|
|
class AvHFont
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
* Constructor.
|
|
*/
|
|
AvHFont();
|
|
|
|
/**
|
|
* Loads the font. Returns true if the font was loaded or false if
|
|
* otherwise.
|
|
*/
|
|
bool Load(const char* inFileName);
|
|
|
|
/**
|
|
* Returns the number of pixels wide a particlar string is when
|
|
* rendered to the screen.
|
|
*/
|
|
int GetStringWidth(const char* inString) const;
|
|
|
|
/**
|
|
* Returns the number of pixels wide a particlar c is when
|
|
* rendered to the screen.
|
|
*/
|
|
int GetCharacterWidth(char c) const;
|
|
|
|
/**
|
|
* Returns the number of pixels wide a string is when rendered to
|
|
* the screen.
|
|
*/
|
|
int GetStringHeight() const;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
int DrawString(int inX, int inY, const char* inString, int r, int g, int b, int inRenderMode = kRenderTransAdd) const;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
int DrawStringReverse(int inX, int inY, const char* inString, int r, int g, int b, int inRenderMode = kRenderTransAdd) const;
|
|
|
|
private:
|
|
|
|
HSPRITE mSprite;
|
|
|
|
int mSpriteWidth;
|
|
int mSpriteHeight;
|
|
|
|
struct CharWidth
|
|
{
|
|
int a;
|
|
int b;
|
|
int c;
|
|
};
|
|
|
|
CharWidth mCharWidth[256];
|
|
|
|
};
|
|
|
|
#endif |