21 std::shared_ptr<Impl> pimpl;
33 const std::string&
name()
const;
39 unsigned flags()
const;
42 double text_width(
const std::string& text)
const;
47 void draw_text(
const std::string& text,
double x,
double y,
ZPos z,
62 double rel_x,
double rel_y,
double scale_x = 1,
double scale_y = 1,
71 double rel_x,
double rel_y,
double scale_x = 1,
double scale_y = 1,
double markup_width(const std::string &markup) const
Returns the width, in pixels, the given markup would occupy if drawn.
void set_image(std::string codepoint, unsigned font_flags, const Gosu::Image &image)
Maps a letter to a specific image, instead of generating one using Gosu's built-in text rendering...
const std::string & name() const
Returns the name of the font that was used to create it.
Represents an RGBA color value with 8 bits for each channel.
void draw_text_rel(const std::string &text, double x, double y, ZPos z, double rel_x, double rel_y, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws text at a position relative to (x; y).
double ZPos
Represents the Z position of something drawn with Gosu's graphics system.
void draw_markup_rel(const std::string &markup, double x, double y, ZPos z, double rel_x, double rel_y, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws text at a position relative to (x; y).
Functions to output text on bitmaps.
Fonts are ideal for drawing short, dynamic strings.
double text_width(const std::string &text) const
Returns the width, in pixels, the given text would occupy if drawn.
void draw_markup(const std::string &markup, double x, double y, ZPos z, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws markup so the top left corner of the text is at (x; y).
int height() const
Returns the height of the font, in pixels.
unsigned flags() const
Returns the flags used to create the font characters.
AlphaMode
Determines the way colors are combined when one is drawn onto another.
std::string default_font_name()
Returns the name of a neutral font that is available on the current platform.
void draw_text(const std::string &text, double x, double y, ZPos z, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws text so the top left corner of the text is at (x; y).
Interface of the Color class.
Provides functionality for drawing rectangular images.
Font(int height, const std::string &name=default_font_name(), unsigned flags=0)
Constructs a font that can be drawn onto the graphics object.
Contains general typedefs and enums related to graphics.