2011-01-16 00:47:37 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* SpriteFont.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX SpriteFont definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _XFX_GRAPHICS_SPRITEFONT_
|
|
|
|
|
#define _XFX_GRAPHICS_SPRITEFONT_
|
|
|
|
|
|
|
|
|
|
#include <Rectangle.h>
|
|
|
|
|
#include "Texture2D.h"
|
|
|
|
|
#include <Vector3.h>
|
|
|
|
|
#include <System/Collections/Generic/List.h>
|
|
|
|
|
#include <System/Types.h>
|
|
|
|
|
|
|
|
|
|
using namespace System;
|
|
|
|
|
using namespace System::Collections::Generic;
|
|
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
|
{
|
|
|
|
|
struct Vector2;
|
|
|
|
|
|
|
|
|
|
namespace Graphics
|
|
|
|
|
{
|
|
|
|
|
class SpriteBatch;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents a font texture.
|
|
|
|
|
/// </summary>
|
|
|
|
|
class SpriteFont
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
List<char> characterMap;
|
|
|
|
|
List<Rectangle> croppingData;
|
|
|
|
|
List<Rectangle> glyphData;
|
|
|
|
|
List<Vector3> kerning;
|
|
|
|
|
int lineSpacing;
|
|
|
|
|
float spacing;
|
2011-05-02 17:33:24 +00:00
|
|
|
|
Texture2D* textureValue;
|
2011-01-16 00:47:37 +00:00
|
|
|
|
|
|
|
|
|
int GetIndexForCharacter(char character);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
int LineSpacing();
|
|
|
|
|
float Spacing;
|
|
|
|
|
|
2011-05-02 17:33:24 +00:00
|
|
|
|
SpriteFont(Texture2D* texture, List<Rectangle> glyphs, List<Rectangle> cropping, List<char> charMap, int lineSpacing, float spacing, List<Vector3> kerning);
|
2011-01-16 00:47:37 +00:00
|
|
|
|
|
|
|
|
|
void Draw(char* text, SpriteBatch spriteBatch, Vector2 textblockPosition, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects_t spriteEffects, float depth);
|
|
|
|
|
Vector2 MeasureString(char* text);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_XFX_GRAPHICS_SPRITEFONT_
|