Cogs.Core
Source
Components
Appearance
FontSelectorComponent.h
1
#include "Components/Core/DynamicComponent.h"
2
3
#include "Resources/Resources.h"
4
5
namespace
Cogs
6
{
7
namespace
Core
8
{
9
class
Context;
10
11
enum class
FontSelectorFlags
12
{
13
ApplyToChildren,
14
SelfOnly
15
};
16
20
class
FontSelectorComponent
:
public
DynamicComponent
21
{
22
public
:
23
FontSelectorComponent
() =
default
;
24
25
void
initialize(
Context
* context);
26
void
update();
27
29
std::string
fontName
=
"Fonts/SourceSansPro-Regular.ttf"
;
31
float
fontSize
= 20.0f;
36
FontSelectorFlags
flags
= FontSelectorFlags::ApplyToChildren;
37
38
FontHandle
fontHandle =
FontHandle::NoHandle
;
39
Context
* context =
nullptr
;
40
41
static
void
registerType();
42
private
:
43
static
void
recurseFontSelection(
const
FontSelectorComponent
* source,
const
Entity* parent);
44
};
45
}
46
}
47
48
template
<>
inline
Cogs::StringView
getName<Cogs::Core::FontSelectorComponent>() {
return
"FontSelectorComponent"
; }
49
50
template
<>
inline
Cogs::StringView
getName<Cogs::Core::FontSelectorFlags>() {
return
"FontSelectorFlags"
; }
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::DynamicComponent
Base class for components implementing dynamic behavior.
Definition:
DynamicComponent.h:31
Cogs::Core::FontSelectorComponent
Creates fontHandle from Font+Size passing handle to other components having the 'fontHandle' field.
Definition:
FontSelectorComponent.h:21
Cogs::Core::FontSelectorComponent::fontName
std::string fontName
Name of Font.
Definition:
FontSelectorComponent.h:29
Cogs::Core::FontSelectorComponent::flags
FontSelectorFlags flags
Definition:
FontSelectorComponent.h:36
Cogs::Core::FontSelectorComponent::fontSize
float fontSize
Size of font.
Definition:
FontSelectorComponent.h:31
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::Core::ResourceHandle_t< Font >
Cogs::Core::ResourceHandle_t< Font >::NoHandle
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.
Definition:
ResourceHandle.h:193
Generated by
1.9.6