2003-01-09 04:45:49 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
|
|
#include "ScreenTestFonts.h"
|
2003-01-10 02:27:23 +00:00
|
|
|
#include "FontManager.h"
|
2003-01-11 03:56:24 +00:00
|
|
|
#include "RageTextureManager.h"
|
2003-01-09 04:45:49 +00:00
|
|
|
|
|
|
|
|
static const float LineWidth = 400;
|
|
|
|
|
static const float LineHeight = 50;
|
|
|
|
|
|
|
|
|
|
ScreenTestFonts::ScreenTestFonts()
|
|
|
|
|
{
|
|
|
|
|
Hline.SetXY(CENTER_X, CENTER_Y);
|
|
|
|
|
Hline.SetZoomX(LineWidth);
|
|
|
|
|
Hline.SetDiffuse( RageColor(1, 1, 1, 1) );
|
|
|
|
|
this->AddChild(&Hline);
|
|
|
|
|
|
|
|
|
|
Vline.SetXY(CENTER_X, CENTER_Y);
|
|
|
|
|
Vline.SetZoomY(LineHeight);
|
|
|
|
|
Vline.SetDiffuse( RageColor(0, 1, 0, .8f) );
|
|
|
|
|
this->AddChild(&Vline);
|
|
|
|
|
|
2003-01-10 02:27:23 +00:00
|
|
|
curfont.SetXY( CENTER_X, CENTER_Y+100 );
|
|
|
|
|
curfont.LoadFromFont( "Themes/default/Fonts/header1" );
|
|
|
|
|
curfont.SetZoom(.5);
|
|
|
|
|
this->AddChild(&curfont);
|
|
|
|
|
|
2003-01-09 04:45:49 +00:00
|
|
|
txt.SetXY( CENTER_X, CENTER_Y );
|
2003-01-10 02:27:23 +00:00
|
|
|
SetFont( "Themes/default/Fonts/header1" );
|
|
|
|
|
SetText( "Foo" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTestFonts::SetText(CString text)
|
|
|
|
|
{
|
|
|
|
|
txt.SetText(""); /* force it */
|
|
|
|
|
txt.SetText(text);
|
|
|
|
|
curtext = text;
|
|
|
|
|
}
|
|
|
|
|
void ScreenTestFonts::SetFont(CString font)
|
|
|
|
|
{
|
|
|
|
|
txt.LoadFromFont( font );
|
|
|
|
|
curfont.SetText(font);
|
|
|
|
|
/* The font changed, so we need to reset the text or it'll be
|
|
|
|
|
* misaligned. */
|
|
|
|
|
SetText(curtext);
|
2003-01-09 04:45:49 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-10 02:27:23 +00:00
|
|
|
void ScreenTestFonts::Draw()
|
|
|
|
|
{
|
|
|
|
|
/* Draw this manually, so we can breakpoint here ... */
|
|
|
|
|
txt.Draw();
|
|
|
|
|
Screen::Draw();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-01-09 04:45:49 +00:00
|
|
|
void ScreenTestFonts::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
if( type != IET_FIRST_PRESS )
|
|
|
|
|
return;
|
|
|
|
|
switch( DeviceI.button )
|
|
|
|
|
{
|
|
|
|
|
case '[': txt.SetVertAlign(align_bottom); break;
|
|
|
|
|
case '\\': txt.SetVertAlign(align_middle); break;
|
|
|
|
|
case ']': txt.SetVertAlign(align_top); break;
|
|
|
|
|
|
|
|
|
|
case ',': txt.SetHorizAlign(align_left); break;
|
|
|
|
|
case '.': txt.SetHorizAlign(align_center); break;
|
|
|
|
|
case '/': txt.SetHorizAlign(align_right); break;
|
|
|
|
|
|
2003-01-10 02:27:23 +00:00
|
|
|
case '1': SetText("Waaai"); break;
|
2003-01-09 04:45:49 +00:00
|
|
|
/* These two kanji are currently two different sizes (20 and 32 pix),
|
|
|
|
|
* and they should be vertically centered with the other text: */
|
2003-01-10 02:27:23 +00:00
|
|
|
case '2': SetText("WAAI &kakumei1;"); break;
|
|
|
|
|
case '3': SetText("WAAI &oni;"); break;
|
|
|
|
|
|
|
|
|
|
case '4': SetText("WAAI\nWAAI"); break;
|
|
|
|
|
case '5': SetText("WAAI &oni;\nWAAI"); break;
|
2003-01-09 04:45:49 +00:00
|
|
|
|
2003-01-10 02:27:23 +00:00
|
|
|
case 'q': SetFont( "Themes/default/Fonts/header1" ); break;
|
|
|
|
|
case 'w': SetFont( "Themes/default/Fonts/header2" ); break;
|
|
|
|
|
case 'e': SetFont( "Themes/default/Fonts/Normal" ); break;
|
|
|
|
|
case 'r': SetFont( "Themes/SMMAX2/Fonts/titlemenu" ); break;
|
2003-01-09 04:45:49 +00:00
|
|
|
|
2003-01-11 03:56:24 +00:00
|
|
|
case 'z': FONT->ReloadFonts();
|
|
|
|
|
TEXTUREMAN->ReloadAll();
|
|
|
|
|
SetText(curtext);
|
|
|
|
|
break;
|
2003-01-09 04:45:49 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|