|
My Project
|
Text drawing routines. More...
#include "font.h"#include "fonthand.h"#include "sprite.h"Functions | |
| void | draw_font_hv_shadow (SDL_Surface *surface, int x, int y, const char *text, Font font, FontAlignment alignment, Uint8 hue, Sint8 value, bool black, int shadow_dist) |
| Draws text in a color specified by hue and value and with a drop shadow. | |
| void | draw_font_hv_full_shadow (SDL_Surface *surface, int x, int y, const char *text, Font font, FontAlignment alignment, Uint8 hue, Sint8 value, bool black, int shadow_dist) |
| Draws text in a color specified by hue and value and with a surrounding shadow. | |
| void | draw_font_hv (SDL_Surface *surface, int x, int y, const char *text, Font font, FontAlignment alignment, Uint8 hue, Sint8 value) |
| Draws text in a color specified by hue and value. | |
| void | draw_font_hv_blend (SDL_Surface *surface, int x, int y, const char *text, Font font, FontAlignment alignment, Uint8 hue, Sint8 value) |
| Draws blended text in a color specified by hue and value. | |
| void | draw_font_dark (SDL_Surface *surface, int x, int y, const char *text, Font font, FontAlignment alignment, bool black) |
| Draws darkened text. | |
Text drawing routines.
| void draw_font_dark | ( | SDL_Surface * | surface, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| Font | font, | ||
| FontAlignment | alignment, | ||
| bool | black ) |
Draws darkened text.
Corresponds to blit_sprite_dark()
| surface | destination surface |
| x | initial x-position in pixels; which direction(s) the text is drawn from this position depends on the alignment |
| y | initial upper y-position in pixels |
| text | text to be drawn |
| font | style/size of text |
| alignment | left_aligned, centered, or right_aligned |
| black | if true text is drawn as solid black, if false text is drawn by darkening the pixels of the destination surface |
| void draw_font_hv | ( | SDL_Surface * | surface, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| Font | font, | ||
| FontAlignment | alignment, | ||
| Uint8 | hue, | ||
| Sint8 | value ) |
Draws text in a color specified by hue and value.
A '~' in the text is not drawn but instead toggles highlighting which increases value by 4.
| surface | destination surface |
| x | initial x-position in pixels; which direction(s) the text is drawn from this position depends on the alignment |
| y | initial upper y-position in pixels |
| text | text to be drawn |
| font | style/size of text |
| alignment | left_aligned, centered, or right_aligned |
| hue | hue component of text color |
| value | value component of text color |
| void draw_font_hv_blend | ( | SDL_Surface * | surface, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| Font | font, | ||
| FontAlignment | alignment, | ||
| Uint8 | hue, | ||
| Sint8 | value ) |
Draws blended text in a color specified by hue and value.
Corresponds to blit_sprite_hv_blend()
| surface | destination surface |
| x | initial x-position in pixels; which direction(s) the text is drawn from this position depends on the alignment |
| y | initial upper y-position in pixels |
| text | text to be drawn |
| font | style/size of text |
| alignment | left_aligned, centered, or right_aligned |
| hue | hue component of text color |
| value | value component of text color |
| void draw_font_hv_full_shadow | ( | SDL_Surface * | surface, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| Font | font, | ||
| FontAlignment | alignment, | ||
| Uint8 | hue, | ||
| Sint8 | value, | ||
| bool | black, | ||
| int | shadow_dist ) |
Draws text in a color specified by hue and value and with a surrounding shadow.
A '~' in the text is not drawn but instead toggles highlighting which increases value by 4.
| surface | destination surface |
| x | initial x-position in pixels; which direction(s) the text is drawn from this position depends on the alignment |
| y | initial upper y-position in pixels |
| text | text to be drawn |
| font | style/size of text |
| alignment | left_aligned, centered, or right_aligned |
| hue | hue component of text color |
| value | value component of text color |
| black | if true the shadow is drawn as solid black, if false the shadow is drawn by darkening the pixels of the destination surface |
| shadow_dist | distance in pixels that the shadows will be drawn away from the text. (This distance is separately added to and subtracted from the x position and y position, resulting in four shadows – one in each cardinal direction. If this shadow distance is small enough, this produces a shadow that outlines the text.) |
| void draw_font_hv_shadow | ( | SDL_Surface * | surface, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| Font | font, | ||
| FontAlignment | alignment, | ||
| Uint8 | hue, | ||
| Sint8 | value, | ||
| bool | black, | ||
| int | shadow_dist ) |
Draws text in a color specified by hue and value and with a drop shadow.
A '~' in the text is not drawn but instead toggles highlighting which increases value by 4.
| surface | destination surface |
| x | initial x-position in pixels; which direction(s) the text is drawn from this position depends on the alignment |
| y | initial upper y-position in pixels |
| text | text to be drawn |
| font | style/size of text |
| alignment | left_aligned, centered, or right_aligned |
| hue | hue component of text color |
| value | value component of text color |
| black | if true the shadow is drawn as solid black, if false the shadow is drawn by darkening the pixels of the destination surface |
| shadow_dist | distance in pixels that the shadow will be drawn away from the text. (This is added to both the x and y positions, so a value of 1 causes the shadow to be drawn 1 pixel right and 1 pixel lower than the text.) |