Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
rendertext.hpp File Reference
#include <math.h>
#include "inexor/shared/cube_formatting.hpp"
#include "inexor/shared/cube_tools.hpp"
#include "inexor/shared/cube_vector.hpp"

Go to the source code of this file.

Classes

struct  font
 
struct  font::charinfo
 

Macros

#define FONTH   (curfont->scale)
 
#define FONTW   (FONTH/2)
 
#define MINRESW   640
 
#define MINRESH   480
 

Functions

bool setfont (const char *name)
 
void pushfont ()
 
bool popfont ()
 
void gettextres (int &w, int &h)
 
void draw_text (const char *str, int left, int top, int r=255, int g=255, int b=255, int a=255, int cursor=-1, int maxwidth=-1)
 
void draw_textf (const char *fstr, int left, int top,...) PRINTFARGS(1
 
void float text_widthf (const char *str)
 
void text_boundsf (const char *str, float &width, float &height, int maxwidth=-1)
 
int text_visible (const char *str, float hitx, float hity, int maxwidth)
 
void text_posf (const char *str, int cursor, float &cx, float &cy, int maxwidth)
 
static int text_width (const char *str)
 
static void text_bounds (const char *str, int &width, int &height, int maxwidth=-1)
 
static void text_pos (const char *str, int cursor, int &cx, int &cy, int maxwidth)
 

Variables

fontcurfont
 
const matrix4x3textmatrix
 

Class Documentation

struct font::charinfo
Class Members
short advance
short h
short offsetx
short offsety
short tex
short w
short x
short y

Macro Definition Documentation

#define FONTH   (curfont->scale)
#define FONTW   (FONTH/2)
#define MINRESH   480

Referenced by gettextres().

#define MINRESW   640

Referenced by gettextres().

Function Documentation

void draw_text ( const char *  str,
int  left,
int  top,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255,
int  cursor = -1,
int  maxwidth = -1 
)
void draw_textf ( const char *  fstr,
int  left,
int  top,
  ... 
)
void gettextres ( int &  w,
int &  h 
)
bool popfont ( )
void pushfont ( )
bool setfont ( const char *  name)
static void text_bounds ( const char *  str,
int &  width,
int &  height,
int  maxwidth = -1 
)
inlinestatic
void text_boundsf ( const char *  str,
float &  width,
float &  height,
int  maxwidth = -1 
)

References FONTH, TEXTLINE, and TEXTSKELETON.

Referenced by text_bounds(), and text_widthf().

static void text_pos ( const char *  str,
int  cursor,
int &  cx,
int &  cy,
int  maxwidth 
)
inlinestatic

References text_posf().

Referenced by editor::draw(), and editor::key().

void text_posf ( const char *  str,
int  cursor,
float &  cx,
float &  cy,
int  maxwidth 
)

References TEXTEND, and TEXTSKELETON.

Referenced by text_pos().

int text_visible ( const char *  str,
float  hitx,
float  hity,
int  maxwidth 
)

References TEXTSKELETON.

Referenced by editor::hit(), and editor::key().

static int text_width ( const char *  str)
inlinestatic
void float text_widthf ( const char *  str)

References text_boundsf().

Referenced by tabify(), and text_width().

Variable Documentation

font* curfont
const matrix4x3* textmatrix