JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
TextLine.hpp
Go to the documentation of this file.
1
// Copyright 2020-2022 Jan Niklas Hasse <jhasse@bixense.com>
2
// For conditions of distribution and use, see copyright notice in LICENSE.txt
5
#pragma once
6
7
#include "
Drawable.hpp
"
8
#include "
Mat3.hpp
"
9
10
#include <
memory
>
11
12
namespace
jngl
{
13
14
class
Font;
15
class
FontImpl;
16
18
class
TextLine
{
19
public
:
20
TextLine
(
Font
&,
std::string
text);
21
void
step();
22
void
draw()
const
;
23
void
draw(
Mat3
modelview
)
const
;
24
void
setText(
std::string
);
25
std::string
getText()
const
;
26
27
Vec2
getSize()
const
;
28
double
getWidth()
const
;
29
double
getHeight()
const
;
30
void
setCenter(
double
x,
double
y);
31
void
setCenter(
Vec2
);
32
double
getX()
const
;
33
void
setX(
double
);
34
double
getY()
const
;
35
void
setY(
double
);
36
void
setPos(
double
,
double
);
37
38
private
:
39
std::string
text;
40
std::shared_ptr<FontImpl>
fontImpl;
41
Vec2
position;
42
};
43
44
}
// namespace jngl
Drawable.hpp
Contains jngl::Drawable class.
Mat3.hpp
Contains jngl::Mat3 class.
std::string
jngl::Font
Font loaded from a TTF or OTF file.
Definition
font.hpp:20
jngl::Mat3
3x3 matrix
Definition
Mat3.hpp:18
jngl::TextLine
Rectangle shaped text (in contrast to jngl::Text this only represents one line)
Definition
TextLine.hpp:18
jngl::Vec2
Two-dimensional vector.
Definition
Vec2.hpp:36
std::function
memory
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
jngl::modelview
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.