Clase para encapsular una fuente de caracteres SDL.
More...
#include <sdl_font.h>
|
EXPORT | Font (Renderer &render, const std::string &fontfile, int ptsize=17) |
| Constructor.
|
|
EXPORT | ~Font () |
| Destructor.
|
|
EXPORT void | SetStyle (int style) |
| Establece el estilo de la fuente.
|
|
EXPORT void | SetSize (int ptsize) |
| Establece el tamaño de la fuente.
|
|
EXPORT void | SetOutline (int outline) |
| Establece el contorno actual de una fuente.
|
|
EXPORT void | SetDirection (TTF_Direction direction) |
| Establece la dirección que se utilizará para dar forma al texto.
|
|
EXPORT void | SetHinting (int hinting) |
| Establece la configuración del interior actual.
|
|
EXPORT Rect | GetArea (const std::string &text) |
| Obtiene el área rectangular necesaria para mostrar el texto indicado.
|
|
EXPORT void | RenderUTF8_Blended (const std::string &text, int x, int y, Color fg) |
| Muestra un texto en pantalla.
|
|
EXPORT void | RenderUTF8_Blended (const std::string &text, Point &p, Color fg) |
| Muestra un texto en pantalla.
|
|
Clase para encapsular una fuente de caracteres SDL.
◆ Font()
EXPORT sdl::Font::Font |
( |
Renderer & | render, |
|
|
const std::string & | fontfile, |
|
|
int | ptsize = 17 ) |
|
inline |
Constructor.
- Parameters
-
render | Renderer& Contexto de renderizado necesario para mostrar texto en pantalla |
fontfile | string& Nombre del fichero que contiene la fuente |
ptsize | int Tamaño de la fuente |
◆ ~Font()
EXPORT sdl::Font::~Font |
( |
| ) |
|
|
inline |
Destructor.
Libera la memoria usada por la fuente
◆ GetArea()
EXPORT Rect sdl::Font::GetArea |
( |
const std::string & | text | ) |
|
Obtiene el área rectangular necesaria para mostrar el texto indicado.
- Parameters
-
text | string& texto para el que se calcula el área |
- Returns
- Rect objeto con las dimensiones del área
◆ RenderUTF8_Blended() [1/2]
EXPORT void sdl::Font::RenderUTF8_Blended |
( |
const std::string & | text, |
|
|
int | x, |
|
|
int | y, |
|
|
Color | fg ) |
Muestra un texto en pantalla.
- Parameters
-
text | string& texto a mostrar |
x | int coordenada x |
y | int coordenada y |
fg | Color color utilizado para el texto |
◆ RenderUTF8_Blended() [2/2]
EXPORT void sdl::Font::RenderUTF8_Blended |
( |
const std::string & | text, |
|
|
Point & | p, |
|
|
Color | fg ) |
|
inline |
Muestra un texto en pantalla.
- Parameters
-
text | string& texto a mostrar |
p | Point& coordenadas |
fg | Color color utilizado para el texto |
◆ SetDirection()
EXPORT void sdl::Font::SetDirection |
( |
TTF_Direction | direction | ) |
|
|
inline |
Establece la dirección que se utilizará para dar forma al texto.
- Parameters
-
direction | TTF_Direction Uno de los valores TTF_Direction para la nueva dirección para el texto: TTF_DIRECTION_LTR (De izquierda a derecha). TTF_DIRECTION_RTL (De derecha a izquierda). TTF_DIRECTION_TTB (De arriba a abajo). TTF_DIRECTION_BTT (de abajo arriba). |
◆ SetHinting()
EXPORT void sdl::Font::SetHinting |
( |
int | hinting | ) |
|
|
inline |
Establece la configuración del interior actual.
- Parameters
-
hinting | int El ajuste de interior es un valor único: TTF_HINTING_NORMAL TTF_HINTING_LIGHT TTF_HINTING_MONO TTF_HINTING_NONE TTF_HINTING_LIGHT_SUBPIXEL (disponible en SDL_ttf 2.0.18 y posteriores) |
◆ SetOutline()
EXPORT void sdl::Font::SetOutline |
( |
int | outline | ) |
|
|
inline |
Establece el contorno actual de una fuente.
- Parameters
-
outline | int un valor de contorno positivo |
◆ SetSize()
EXPORT void sdl::Font::SetSize |
( |
int | ptsize | ) |
|
|
inline |
Establece el tamaño de la fuente.
- Parameters
-
ptsize | int nuevo tamaño de la fuente |
◆ SetStyle()
EXPORT void sdl::Font::SetStyle |
( |
int | style | ) |
|
|
inline |
Establece el estilo de la fuente.
Permite establecer uno o varios estilos combinados con OR entre los disponibles: TTF_STYLE_NORMAL, TTF_STYLE_BOLD, TTF_STYLE_ITALIC, TTF_STYLE_UNDERLINE y TTF_STYLE_STRIKETHROUGH
- Parameters
-
style | int nuevo estilo para aplicar a la fuente |
◆ font
TTF_Font* sdl::Font::font |
|
protected |
◆ renderer
Contexto de renderizado para mostrar texto
The documentation for this class was generated from the following files: