Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
73
include/Spectre/Graphics/Text.h
Normal file
73
include/Spectre/Graphics/Text.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
#ifndef SPECTRE_GRAPHICS_TEXT_H
|
||||
#define SPECTRE_GRAPHICS_TEXT_H
|
||||
|
||||
#include <string>
|
||||
#include <Spectre/Math/Color.h>
|
||||
#include <Spectre/Graphics/Font.h>
|
||||
#include <Spectre/Graphics/Transformable.h>
|
||||
#include <Spectre/Graphics/Renderable.h>
|
||||
|
||||
class Text : public Renderable2D
|
||||
{
|
||||
public :
|
||||
/* TODO
|
||||
enum Properties
|
||||
{
|
||||
Regular = 0,
|
||||
Bold = 1 << 0,
|
||||
Italic = 1 << 1,
|
||||
Underline = 1 << 2,
|
||||
StrikeThrough = 1 << 3
|
||||
};
|
||||
|
||||
enum Alignment
|
||||
{
|
||||
Left,
|
||||
Right,
|
||||
Center
|
||||
}; */
|
||||
|
||||
Text();
|
||||
|
||||
Text(const std::string text, const Font& font);
|
||||
|
||||
void setString(const std::string& string);
|
||||
const std::string& getString() const;
|
||||
|
||||
void setFont(const Font& font);
|
||||
const Font* getFont() const;
|
||||
|
||||
void setColor(const Color& color);
|
||||
const Color& getColor() const;
|
||||
|
||||
Vector2f getSize() const;
|
||||
|
||||
virtual const std::vector<Vertex2D>& getVertices() const;
|
||||
|
||||
virtual const std::vector<unsigned short>& getIndices() const;
|
||||
|
||||
virtual const RenderType getRenderType() const { return RenderType_UI; };
|
||||
|
||||
virtual const Texture* getTexture() const;
|
||||
|
||||
private :
|
||||
|
||||
void updateGeometry() const;
|
||||
|
||||
private :
|
||||
|
||||
// String containing the text.
|
||||
std::string m_string;
|
||||
|
||||
const Font* m_font;
|
||||
|
||||
Color m_color;
|
||||
|
||||
std::vector<unsigned short> m_indicies;
|
||||
|
||||
mutable bool m_geometryNeedsUpdate;
|
||||
mutable std::vector<Vertex2D> m_vertices;
|
||||
};
|
||||
|
||||
#endif /* SPECTRE_GRAPHICS_TEXT_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue