-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jonaslindemann/develop
Develop
- Loading branch information
Showing
12 changed files
with
369 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include <ivf/Billboard.h> | ||
#include <ivf/Composite.h> | ||
#include <ivf/QuadPlane.h> | ||
#include <ivf/Texture.h> | ||
#include <ivf/BitmapFont.h> | ||
|
||
namespace ivf { | ||
|
||
enum class HorizontalAlignment { Left, Center, Right }; | ||
enum class VerticalAlignment {Top, Middle, Bottom }; | ||
|
||
IvfSmartPointer(TextLabel); | ||
|
||
class TextLabel : public ivf::BillBoard { | ||
private: | ||
ivf::BitmapFontPtr m_font; | ||
std::string m_text; | ||
ivf::CompositePtr m_textQuads; | ||
float m_textWidth; | ||
float m_textHeight; | ||
float m_textSize; | ||
|
||
HorizontalAlignment m_alignX; | ||
VerticalAlignment m_alignY; | ||
private: | ||
void updateText(); | ||
void updateExistingText(); | ||
public: | ||
TextLabel(); | ||
|
||
IvfClassInfo("TextLabel", Composite); | ||
|
||
static TextLabelPtr create() { return TextLabelPtr(new ivf::TextLabel()); } | ||
|
||
void setFont(ivf::BitmapFont* font); | ||
ivf::BitmapFont* font(); | ||
|
||
void setText(const std::string text, float size=1.0); | ||
const std::string text(); | ||
|
||
void setSize(float size); | ||
float size(); | ||
|
||
void setAlignment(HorizontalAlignment alignX, VerticalAlignment alignY = ivf::VerticalAlignment::Bottom); | ||
|
||
protected: | ||
virtual void doPreGeometry() override; | ||
virtual void doPostGeometry() override; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.