Gamedev Framework (gf)  0.2.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::DefaultUIRenderer Class Reference

The default renderer for user interface. More...

#include <gf/UI.h>

Inheritance diagram for gf::DefaultUIRenderer:
Inheritance graph
[legend]

Public Member Functions

 DefaultUIRenderer (gf::Font &font)
 Constructor. More...
 
virtual void drawRect (RenderTarget &target, const RectF &rect, float corner, UIFlags flags) const override
 Draw a rectangle. More...
 
virtual void drawText (RenderTarget &target, const std::string &text, unsigned size, Vector2f pos, float width, Alignment alignment, UIFlags flags) const override
 Draw a text. More...
 
virtual void drawIcon (RenderTarget &target, Vector2f pos, UIIcon icon, UIFlags flags) const override
 Draw an icon. More...
 
- Public Member Functions inherited from gf::UIRenderer
virtual ~UIRenderer ()
 Virtual destructor. More...
 

Detailed Description

The default renderer for user interface.

See also
gf::UI, gf::UIRenderer

Constructor & Destructor Documentation

gf::DefaultUIRenderer::DefaultUIRenderer ( gf::Font font)

Constructor.

Parameters
fontThe font to display the text

Member Function Documentation

virtual void gf::DefaultUIRenderer::drawIcon ( RenderTarget target,
Vector2f  pos,
UIIcon  icon,
UIFlags  flags 
) const
overridevirtual

Draw an icon.

Parameters
targetThe target to draw on
posThe position of the icon (center)
iconThe icon to draw
flagsThe status of the widget

Implements gf::UIRenderer.

virtual void gf::DefaultUIRenderer::drawRect ( RenderTarget target,
const RectF rect,
float  corner,
UIFlags  flags 
) const
overridevirtual

Draw a rectangle.

Parameters
targetThe target to draw on
rectThe coordinates of the rectangle to draw
cornerThe corner size (or no corner if 0)
flagsThe status of the widget

Implements gf::UIRenderer.

virtual void gf::DefaultUIRenderer::drawText ( RenderTarget target,
const std::string &  text,
unsigned  size,
Vector2f  pos,
float  width,
Alignment  alignment,
UIFlags  flags 
) const
overridevirtual

Draw a text.

Parameters
targetThe target to draw on
textThe text to draw
sizeThe character size of the text
posThe position of the text (top-left corner)
widthThe availabe width for the text
alignmentThe alignment of the text
flagsThe status of the widget

Implements gf::UIRenderer.