## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iPen Struct Reference

A pen is used to draw vector shapes. More...

`#include <cstool/pen.h>`

Inheritance diagram for iPen:

[legend]
List of all members.

## Public Member Functions

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, bool swap_colors=false, bool fill=false)=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, float miter, bool swap_colors=false, bool fill=false)=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, bool swap_colors=false, bool fill=false)=0
| Draws a rectangle.
virtual void | DrawRoundedRect (uint x1, uint y1, uint x2, uint y2, float roundness, bool swap_colors=false, bool fill=false)=0
| Draws a rounded rectangle.
virtual void | DrawTriangle (uint x1, uint y1, uint x2, uint y2, uint x3, uint y3, bool fill=false)=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 (const csColor4 &color)=0
| Sets the current color.
virtual void | SetColor (float r, float g, float b, float a)=0
| Sets the current color.
virtual void | SetOrigin (const csVector3 &o)=0
| Sets the origin of the coordinate system.
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, 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, char *text)=0
| Writes text in the given font, in the given box.

## Detailed Description

A pen is used to draw vector shapes.

Definition at line 52 of file pen.h.

## Member Function Documentation

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,
|  | bool | swap_colors = `false`,
|  | bool | fill = `false`
| ) | `[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,
|  | float | miter,
|  | bool | swap_colors = `false`,
|  | bool | fill = `false`
| ) | `[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,
|  | bool | swap_colors = `false`,
|  | bool | fill = `false`
| ) | `[pure virtual]`

| Draws a rectangle. Implemented in csPen.

virtual void iPen::DrawRoundedRect | ( | uint | x1,
|  | uint | y1,
|  | uint | x2,
|  | uint | y2,
|  | float | roundness,
|  | bool | swap_colors = `false`,
|  | bool | fill = `false`
| ) | `[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,
|  | bool | fill = `false`
| ) | `[pure virtual]`

| Draws a triangle around the given vertices. Implemented in csPen.

virtual void iPen::PopTransform | ( |  | ) | `[pure virtual]`

| Pops the transform stack. The top of the stack becomes the current transform. Implemented in csPen.

virtual void iPen::PushTransform | ( |  | ) | `[pure virtual]`

| Pushes the current transform onto the stack. * Implemented in csPen.

virtual void iPen::Rotate | ( | const float & | a | ) | `[pure virtual]`

| Rotates by the given angle. Implemented in csPen.

virtual void iPen::SetColor | ( | const csColor4 & | color | ) | `[pure virtual]`

| Sets the current color. Implemented in csPen.

virtual void iPen::SetColor | ( | float | r,
|  | float | g,
|  | float | b,
|  | float | a
| ) | `[pure virtual]`

| Sets the current color. Implemented in csPen.

virtual void iPen::SetOrigin | ( | const csVector3 & | o | ) | `[pure virtual]`

| Sets the origin of the coordinate system. Implemented in csPen.

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,
|  | 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,
|  | 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.

The documentation for this struct was generated from the following file:

- cstool/pen.h