Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_graphics
Text
Text.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
TextLayout.hpp
"
4
#include "../Elements/TranslucentElem.hpp"
5
#include "../Elements/Elem.hpp"
6
#include "../Elements/ElementRenderer.hpp"
7
#include <
ivorium_systems/ivorium_systems.hpp
>
8
9
namespace
iv
10
{
11
16
class
Text
:
public
Elem
,
public
TextSegment
,
public
TranslucentElem
,
public
Renderable
17
{
18
public
:
19
ClientMarker
cm
;
20
using
Elem::instance
;
21
Text
(
Instance
* inst );
22
23
void
status
(
iv::TableDebugView
* view );
24
25
// initialization parameters
26
DirtyAttr< std::string >
attr_text
;
27
DirtyAttr< ResourcePath >
attr_font
;
28
DirtyAttr< float >
attr_fontSize
;
29
DirtyAttr< float4 >
attr_color
;
30
//DirtyAttr< bool > attr_fixedAllowed;
31
32
// utils
33
// Elem
34
Text
*
enabled
(
bool
);
35
36
// TranslucentElem
37
Text
*
preblend
(
float4
val );
38
Text
*
translucent
(
bool
val );
39
40
// Text
41
Text
*
text
( std::string
const
& );
42
Text
*
font
(
ResourcePath
const
& );
43
Text
*
fontSize
(
float
);
44
Text
*
color
(
float4
);
45
//Text * fixedAllowed( bool );
46
47
//
48
Text
*
font_DVar
(
DVarIdT< ResourcePath >
id
);
49
50
protected
:
51
// Elem
52
virtual
void
first_pass_impl
(
ElementRenderer
* )
override
;
53
virtual
void
second_pass_impl
(
ElementRenderer
* )
override
;
54
55
private
:
56
// TextSegment
57
virtual
FontMesh::Geometry
geometry_Compute(
FontMesh::Location
const
&
location
)
override
;
58
59
// Renderable
60
virtual
void
render(
CameraState
const
& camera, std::optional< float > depth_override )
override
;
61
62
private
:
63
FontMesh
mesh;
64
Heap
heap;
65
};
66
67
68
}