70 bool flip_x =
false,
bool flip_y =
false);
94 const asw::Quad<float>& dest,
float angle,
bool flip_x =
false,
bool flip_y =
false);
void sprite(const asw::Texture &tex, const asw::Vec2< float > &position)
Draw a sprite.
void circle_fill(const asw::Vec2< float > &position, float radius, asw::Color color)
Draw a filled circle.
void stretch_sprite_rotate(const asw::Texture &tex, const asw::Quad< float > &dest, float angle, bool flip_x=false, bool flip_y=false)
Draw a sprite stretched to a quad, rotated around its centre and optionally flipped.
void polygon(const asw::Polygonf &points, asw::Color color)
Draw the outline of a polygon. The last point joins the first.
void set_scale_mode(const asw::Texture &texture, asw::ScaleMode mode)
Set the scale mode of a texture. Nearest keeps hard pixel edges, linear smooths the texture when it i...
void clear_color(asw::Color color)
Clear the screen to a color.
void rect(const asw::Quad< float > &position, asw::Color color, float thickness=1.0F)
Draw a rectangle.
void line(const asw::Vec2< float > &position1, const asw::Vec2< float > &position2, asw::Color color)
Draw a line.
void triangle_fill(const asw::Vec2< float > &a, const asw::Vec2< float > &b, const asw::Vec2< float > &c, asw::Color color)
Draw a filled triangle.
void set_tint(const asw::Texture &texture, asw::Color tint)
Set the tint of a texture. Each colour channel is multiplied by the tint when drawn,...
void rotate_sprite(const asw::Texture &tex, const asw::Vec2< float > &position, float angle)
Draw a sprite with the option to rotate it.
void stretch_sprite(const asw::Texture &tex, const asw::Quad< float > &position)
Draw a sprite with the option to stretch it.
void text_shadow(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color, asw::Color shadow=asw::Color(0, 0, 0), const asw::Vec2< float > &offset=asw::Vec2< float >(2.0F, 2.0F), asw::TextJustify justify=asw::TextJustify::Left)
Draw text with a drop shadow behind it, so it reads on any background. The shadow fades with the text...
void clear_text_cache()
Clear cached rendered text textures.
void text(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color, asw::TextJustify justify=asw::TextJustify::Left)
Draw text. The position is rounded to whole pixels after justification so glyphs stay sharp....
void polygon_fill(const asw::Polygonf &points, asw::Color color)
Draw a filled polygon. The polygon can be concave, but its edges must not cross.
void circle(const asw::Vec2< float > &position, float radius, asw::Color color)
Draw a circle.
void rect_fill(const asw::Quad< float > &position, asw::Color color)
Draw a filled rectangle.
void sprite_flip(const asw::Texture &tex, const asw::Vec2< float > &position, bool flip_x, bool flip_y)
Draw a sprite with the option to flip it.
void point(const asw::Vec2< float > &position, asw::Color color)
Draw a point.
void set_blend_mode(const asw::Texture &texture, asw::BlendMode mode)
Set the blend mode of a texture.
void stretch_sprite_blit(const asw::Texture &tex, const asw::Quad< float > &source, const asw::Quad< float > &dest)
Draw a sprite with the option to stretch a portion of it.
void stretch_sprite_rotate_blit(const asw::Texture &tex, const asw::Quad< float > &source, const asw::Quad< float > &dest, float angle, bool flip_x=false, bool flip_y=false)
Draw a sprite with the option to stretch and rotate a portion of it.
void set_alpha(const asw::Texture &texture, float alpha)
Set the alpha of a texture.
void rect_fill_rotate(const asw::Quad< float > &position, float angle, asw::Color color)
Draw a filled rectangle rotated around its centre.
std::shared_ptr< TTF_Font > Font
Alias for a shared pointer to an TTF_Font.
Polygon< float > Polygonf
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
BlendMode
Mappings from SDL_BLENDMODE to ASW BlendMode.
ScaleMode
Mappings from SDL_SCALEMODE to ASW ScaleMode.
TextJustify
Text justification options for text rendering.
RGBA color struct with 8-bit channels.
Types used throughout the ASW library.