using System;
using Microsoft.DirectX.DirectDraw;
using Global;
using KillerInstinct.DirectX;
using Global.GlobalClass;
namespace KillerInstinct.Sprites{
public class TextClass : SpriteClass
{
// game text constants
public TextClass(string file, float x, float y)
{
frame.Width = 400;
frame.Height = 70;
framesCount = 1;
framesPerRow = 1;
layer = LAYER_TOP;
Init(GetRandomText(file), CONST.COLORKEY_NO, x, y);
}
public void ChangeText(string file)
{
Init(GetRandomText(file), CONST.COLORKEY_NO, posX, posY);
}
public void ChangeText(string file, byte colorKey)
{
Init(GetRandomText(file), colorKey, posX, posY);
}
private static string GetRandomText(string text)
{
return (GetRandomResource("GameText_" + text + "*.bmp"));
}
private static string GetTextResource(string text)
{
global.dbg.Out(Debug.DBG2, "GetTextResource: " + CONST.DIR_BITMAP + "GameText_" + text + ".bmp");
return (CONST.DIR_BITMAP + "GameText_" + text + ".bmp");
}
public override void Update()
{
}
public override void ReactToCollision(SpriteClass s)
{
}
}
}
|