![]() |
Public API Reference |
![]() |
A pen is used to draw vector shapes. More...
#include <cstool/pen.h>
Public Member Functions | |
virtual void | ClearFlag (uint flag)=0 |
Clears the given flag. | |
virtual void | ClearTransform ()=0 |
Clears the current transform, resets to identity. | |
virtual void | DrawArc (uint x1, uint y1, uint x2, uint y2, float start_angle, float end_angle)=0 |
Draws an elliptical arc from start angle to end angle. | |
virtual void | DrawLine (uint x1, uint y1, uint x2, uint y2)=0 |
Draws a single line. | |
virtual void | DrawMiteredRect (uint x1, uint y1, uint x2, uint y2, uint miter)=0 |
Draws a mitered rectangle. | |
virtual void | DrawPoint (uint x1, uint y2)=0 |
Draws a single point. | |
virtual void | DrawRect (uint x1, uint y1, uint x2, uint y2)=0 |
Draws a rectangle. | |
virtual void | DrawRoundedRect (uint x1, uint y1, uint x2, uint y2, uint roundness)=0 |
Draws a rounded rectangle. | |
virtual void | DrawTriangle (uint x1, uint y1, uint x2, uint y2, uint x3, uint y3)=0 |
Draws a triangle around the given vertices. | |
virtual void | PopTransform ()=0 |
Pops the transform stack. | |
virtual void | PushTransform ()=0 |
Pushes the current transform onto the stack. | |
virtual void | Rotate (const float &a)=0 |
Rotates by the given angle. | |
virtual void | SetColor (float r, float g, float b, float a)=0 |
Sets the current color. | |
virtual void | SetColor (const csColor4 &color)=0 |
Sets the current color. | |
virtual void | SetFlag (uint flag)=0 |
Sets the given flag. | |
virtual void | SetMixMode (uint mode)=0 |
Sets the given mix (blending) mode. | |
virtual void | SetOrigin (const csVector3 &o)=0 |
Sets the origin of the coordinate system. | |
virtual void | SetPenWidth (float width)=0 |
Sets the width of the pen for line drawing. | |
virtual void | SetTexture (csRef< iTextureHandle > tex)=0 |
Sets the texture handle. | |
virtual void | SwapColors ()=0 |
Swaps the current color and the alternate color. | |
virtual void | Translate (const csVector3 &t)=0 |
Translates by the given vector. | |
virtual void | Write (iFont *font, uint x1, uint y1, const char *text)=0 |
Writes text in the given font at the given location. | |
virtual void | WriteBoxed (iFont *font, uint x1, uint y1, uint x2, uint y2, uint h_align, uint v_align, const char *text)=0 |
Writes text in the given font, in the given box. | |
virtual void | WriteLines (iFont *font, uint x1, uint y1, const csStringArray &lines)=0 |
Writes multiple lines of text in the given font at the given location. | |
virtual void | WriteLinesBoxed (iFont *font, uint x1, uint y1, uint x2, uint y2, uint h_align, uint v_align, const csStringArray &lines)=0 |
Writes multiple lines of text in the given font, in the given box. |
virtual void iPen::ClearFlag | ( | uint | flag | ) | [pure virtual] |
virtual void iPen::ClearTransform | ( | ) | [pure virtual] |
Clears the current transform, resets to identity.
Implemented in csPen.
virtual void iPen::DrawArc | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
float | start_angle, | ||
float | end_angle | ||
) | [pure virtual] |
Draws an elliptical arc from start angle to end angle.
Angle must be specified in radians. The arc will be made to fit in the given box. If you want a circular arc, make sure the box is a square. If you want a full circle or ellipse, specify 0 as the start angle and 2*PI as the end angle.
Implemented in csPen.
virtual void iPen::DrawLine | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2 | ||
) | [pure virtual] |
Draws a single line.
Implemented in csPen.
virtual void iPen::DrawMiteredRect | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
uint | miter | ||
) | [pure virtual] |
Draws a mitered rectangle.
The miter value should be between 0.0 and 1.0, and determines how much of the corner is mitered off and beveled.
Implemented in csPen.
virtual void iPen::DrawPoint | ( | uint | x1, |
uint | y2 | ||
) | [pure virtual] |
Draws a single point.
Implemented in csPen.
virtual void iPen::DrawRect | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2 | ||
) | [pure virtual] |
Draws a rectangle.
Implemented in csPen.
virtual void iPen::DrawRoundedRect | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
uint | roundness | ||
) | [pure virtual] |
Draws a rounded rectangle.
The roundness value should be between 0.0 and 1.0, and determines how much of the corner is rounded off.
Implemented in csPen.
virtual void iPen::DrawTriangle | ( | uint | x1, |
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
uint | x3, | ||
uint | y3 | ||
) | [pure virtual] |
Draws a triangle around the given vertices.
Implemented in csPen.
virtual void iPen::PopTransform | ( | ) | [pure virtual] |
virtual void iPen::PushTransform | ( | ) | [pure virtual] |
virtual void iPen::Rotate | ( | const float & | a | ) | [pure virtual] |
Rotates by the given angle.
Implemented in csPen.
virtual void iPen::SetColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) | [pure virtual] |
Sets the current color.
r | The red component. |
g | The green component. |
b | The blue component. |
a | The alpha component. |
Implemented in csPen.
virtual void iPen::SetColor | ( | const csColor4 & | color | ) | [pure virtual] |
Sets the current color.
Implemented in csPen.
virtual void iPen::SetFlag | ( | uint | flag | ) | [pure virtual] |
virtual void iPen::SetMixMode | ( | uint | mode | ) | [pure virtual] |
virtual void iPen::SetOrigin | ( | const csVector3 & | o | ) | [pure virtual] |
Sets the origin of the coordinate system.
Implemented in csPen.
virtual void iPen::SetPenWidth | ( | float | width | ) | [pure virtual] |
Sets the width of the pen for line drawing.
Implemented in csPen.
virtual void iPen::SetTexture | ( | csRef< iTextureHandle > | tex | ) | [pure virtual] |
virtual void iPen::SwapColors | ( | ) | [pure virtual] |
Swaps the current color and the alternate color.
Implemented in csPen.
virtual void iPen::Translate | ( | const csVector3 & | t | ) | [pure virtual] |
Translates by the given vector.
Implemented in csPen.
virtual void iPen::Write | ( | iFont * | font, |
uint | x1, | ||
uint | y1, | ||
const char * | text | ||
) | [pure virtual] |
Writes text in the given font at the given location.
Implemented in csPen.
virtual void iPen::WriteBoxed | ( | iFont * | font, |
uint | x1, | ||
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
uint | h_align, | ||
uint | v_align, | ||
const char * | text | ||
) | [pure virtual] |
Writes text in the given font, in the given box.
The alignment specified in h_align and v_align determine how it should be aligned.
Implemented in csPen.
virtual void iPen::WriteLines | ( | iFont * | font, |
uint | x1, | ||
uint | y1, | ||
const csStringArray & | lines | ||
) | [pure virtual] |
Writes multiple lines of text in the given font at the given location.
Implemented in csPen.
virtual void iPen::WriteLinesBoxed | ( | iFont * | font, |
uint | x1, | ||
uint | y1, | ||
uint | x2, | ||
uint | y2, | ||
uint | h_align, | ||
uint | v_align, | ||
const csStringArray & | lines | ||
) | [pure virtual] |
Writes multiple lines of text in the given font, in the given box.
The alignment specified in h_align and v_align determine how it should be aligned.
Implemented in csPen.