UI Label Wrap
This commit is contained in:
@ -22,6 +22,9 @@ namespace Dawn {
|
||||
struct UILabelText {
|
||||
std::string text;
|
||||
struct UILabelStyle style;
|
||||
|
||||
glm::vec2 position;
|
||||
glm::vec2 size;
|
||||
|
||||
// Part index?
|
||||
// Quad start?
|
||||
@ -39,29 +42,9 @@ namespace Dawn {
|
||||
Mesh mesh;
|
||||
FontShaderBuffer shaderBuffer;
|
||||
std::vector<struct UILabelText> texts;
|
||||
std::vector<struct UILabelText> textsBuffered;
|
||||
std::map<NewTrueTypeFaceTexture*, int32_t> textureMap;
|
||||
|
||||
/**
|
||||
* Buffers the quads for the given text and updates the progressing values
|
||||
* as the buffer process continues.
|
||||
*
|
||||
* @param text Text information to buffer.
|
||||
* @param bufferData The output quad mappings for the text.
|
||||
* @param textureMap Texture map for the textures to map.
|
||||
* @param position The 2D position to buffer the quads at.
|
||||
* @param quadStart The starting quad index.
|
||||
* @param partIndex The part index to store for each quad buffered.
|
||||
* @return The number of quads buffered, not the string length.
|
||||
*/
|
||||
int32_t bufferQuads(
|
||||
struct UILabelText text,
|
||||
struct FontShaderBufferData &bufferData,
|
||||
std::map<NewTrueTypeFaceTexture*, int32_t> &textureMap,
|
||||
glm::vec2 &position,
|
||||
int32_t quadStart,
|
||||
int32_t partIndex
|
||||
);
|
||||
|
||||
public:
|
||||
int32_t quadStart = 0;
|
||||
int32_t quadCount = -1;
|
||||
|
Reference in New Issue
Block a user