Files
itgmania212121/stepmania/src/BitmapText.h
T

57 lines
1.3 KiB
C++
Raw Normal View History

/*
-----------------------------------------------------------------------------
File: BitmapText.h
Desc: A font class that draws characters from a bitmap.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
2001-11-03 10:52:42 +00:00
#ifndef _BITMAPTEXT_H_
#define _BITMAPTEXT_H_
#include "Sprite.h"
#include "BitmapText.h"
const int NUM_CHARS = 256;
2001-11-03 10:52:42 +00:00
class BitmapText : public Sprite
2001-11-03 10:52:42 +00:00
{
protected:
2001-11-03 10:52:42 +00:00
public:
BitmapText();
2001-11-25 04:31:44 +00:00
bool LoadFromFontName( CString sFontName );
void SetText( CString sText ) { m_sText = sText; };
2001-11-03 10:52:42 +00:00
CString GetText() { return m_sText; };
bool LoadFontWidths( CString sFilePath );
//float GetWidthZoomed();
2001-11-25 04:31:44 +00:00
// void SetTopColor( D3DXCOLOR new_color ) { m_colorTop = new_color; };
// void SetBottomColor( D3DXCOLOR new_color ) { m_colorBottom = new_color; };
// void SetColor( D3DXCOLOR new_color ) { SetTopColor(new_color); SetBottomColor(new_color); };
void Draw();
2001-11-03 10:52:42 +00:00
2001-12-19 01:50:57 +00:00
float GetWidthInSourcePixels(); // in logical, pre-scaled units
2001-11-03 10:52:42 +00:00
protected:
bool LoadCharWidths( CString sWidthFilePath );
2001-11-25 04:31:44 +00:00
CString m_sFontName;
float m_fCharWidthsInSourcePixels[NUM_CHARS]; // in soure coordinate space
2001-11-03 10:52:42 +00:00
CString m_sText; // the string that the font is displaying
// D3DXCOLOR m_colorTop;
// D3DXCOLOR m_colorBottom;
2001-12-19 01:50:57 +00:00
// bool m_bHasShadow;
2001-11-03 10:52:42 +00:00
};
#endif