mirror of
https://github.com/Halofreak1990/XFXFramework
synced 2024-12-26 13:49:34 +01:00
Added 'ValueTypes' Single and Double Added some components in the new System::Net namespace Added the Console class, which can be used to output text to the screen Updated a bunch of structs to include the IComparable and IEquatable interfaces, and inheritance from Object to allow better interoperability between container classes and other types Replaced all exception handling code with a report to stdout.txt - this will, I hope, eventually be reversed, but as of yet, there is no support for exceptions. BEWARE! Even though all libraries correctly compile, you cannot use any class/structure that inherits from a template class, because stupid G++ wants to include exception handling for each template.
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
/********************************************************
|
|
* SpriteFont.h *
|
|
* *
|
|
* XFX SpriteFont definition file *
|
|
* Copyright © 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/Object.h>
|
|
#include <System/Types.h>
|
|
|
|
using namespace System;
|
|
using namespace System::Collections::Generic;
|
|
|
|
namespace XFX
|
|
{
|
|
struct Vector2;
|
|
|
|
namespace Graphics
|
|
{
|
|
class SpriteBatch;
|
|
|
|
// Represents a font texture.
|
|
class SpriteFont : virtual Object
|
|
{
|
|
private:
|
|
friend class SpriteBatch;
|
|
|
|
List<char> characterMap;
|
|
List<Rectangle> croppingData;
|
|
List<Rectangle> glyphData;
|
|
List<Vector3> kerning;
|
|
int lineSpacing;
|
|
float spacing;
|
|
Texture2D textureValue;
|
|
|
|
int GetIndexForCharacter(char character);
|
|
|
|
SpriteFont(Texture2D texture, List<Rectangle> glyphs, List<Rectangle> cropping, List<char> charMap, int lineSpacing, float spacing, List<Vector3> kerning);
|
|
|
|
void Draw(char* text, SpriteBatch spriteBatch, Vector2 textblockPosition, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects_t spriteEffects, float depth);
|
|
|
|
public:
|
|
int LineSpacing();
|
|
float Spacing;
|
|
|
|
Vector2 MeasureString(char* text);
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif //_XFX_GRAPHICS_SPRITEFONT_
|