Torque2D Reference
Loading...
Searching...
No Matches

Functions

void dglDrawLine (S32 x1, S32 y1, S32 x2, S32 y2, const ColorI &color)
 draws a line from x1,y1 to x2,y2 in the specified color
void dglDrawLine (const Point2I &startPt, const Point2I &endPt, const ColorI &color)
 draws a line from startPt to endPt in specified color
void dglDrawTriangleFill (const Point2I &pt1, const Point2I &pt2, const Point2I &pt3, const ColorI &color)
 draws an UNTEXTURED filled triangle with the three points which should be given in counterclockwise order
void dglDrawRect (const Point2I &upperL, const Point2I &lowerR, const ColorI &color, const float &lineWidth=1.0f)
 draws a wireframe rectangle from upperL to lowerR in specified color and optional line width
void dglDrawRect (const RectI &rect, const ColorI &color, const float &lineWidth=1.0f)
 draws a wireframe rectangle in "rect" in specified color and optional line width
void dglDrawRectFill (const Point2I &upperL, const Point2I &lowerR, const ColorI &color)
 draws an UNTEXTURED filled rectangle from upperL to lowerR in specified color
void dglDrawRectFill (const RectI &rect, const ColorI &color)
 draws an UNTEXTURED filled rectangle in "rect" in specified color
void dglDrawQuadFill (const Point2I &point1, const Point2I &point2, const Point2I &point3, const Point2I &point4, const ColorI &color)
 draws an UNTEXTURED filled quad in specified color
void dglDrawDot (const Point2F &screenPoint, const ColorI &color)
 draws a dot.
void dglDraw2DSquare (const Point2F &screenPoint, F32 width, F32 spinAngle)
 draws a square, with center point "screenPoint", width of "width" on an angle of "spinAngle" in 2d
void dglDrawBillboard (const Point3F &position, F32 width, F32 spinAngle)
 draws a square, with center point "position", width of "width" on an angle of "spinAngle" in 3d
void dglWireCube (const Point3F &extent, const Point3F &center)
 Draws a wireframe cube around "center" with size "extent".
void dglSolidCube (const Point3F &extent, const Point3F &enter)
 Draws a solid cube around "center" with size "extent".
void dglDrawCircle (const Point2I &center, const F32 radius, const ColorI &color, const F32 &lineWidth=1.0f)
 Draws an unfilled circle using line segments.
void dglDrawCircleFill (const Point2I &center, const F32 radius, const ColorI &color)
 Draws a filled circle.

Detailed Description

Easy functions for drawing lines and (un)textured rectangles in 2d or 3d space

Function Documentation

◆ dglDraw2DSquare()

void dglDraw2DSquare ( const Point2F & screenPoint,
F32 width,
F32 spinAngle )

draws a square, with center point "screenPoint", width of "width" on an angle of "spinAngle" in 2d

◆ dglDrawBillboard()

void dglDrawBillboard ( const Point3F & position,
F32 width,
F32 spinAngle )

draws a square, with center point "position", width of "width" on an angle of "spinAngle" in 3d

◆ dglDrawCircle()

void dglDrawCircle ( const Point2I & center,
const F32 radius,
const ColorI & color,
const F32 & lineWidth = 1.0f )

Draws an unfilled circle using line segments.

◆ dglDrawCircleFill()

void dglDrawCircleFill ( const Point2I & center,
const F32 radius,
const ColorI & color )

Draws a filled circle.

◆ dglDrawDot()

void dglDrawDot ( const Point2F & screenPoint,
const ColorI & color )

draws a dot.

◆ dglDrawLine() [1/2]

void dglDrawLine ( const Point2I & startPt,
const Point2I & endPt,
const ColorI & color )

draws a line from startPt to endPt in specified color

◆ dglDrawLine() [2/2]

void dglDrawLine ( S32 x1,
S32 y1,
S32 x2,
S32 y2,
const ColorI & color )

draws a line from x1,y1 to x2,y2 in the specified color

◆ dglDrawQuadFill()

void dglDrawQuadFill ( const Point2I & point1,
const Point2I & point2,
const Point2I & point3,
const Point2I & point4,
const ColorI & color )

draws an UNTEXTURED filled quad in specified color

◆ dglDrawRect() [1/2]

void dglDrawRect ( const Point2I & upperL,
const Point2I & lowerR,
const ColorI & color,
const float & lineWidth = 1.0f )

draws a wireframe rectangle from upperL to lowerR in specified color and optional line width

◆ dglDrawRect() [2/2]

void dglDrawRect ( const RectI & rect,
const ColorI & color,
const float & lineWidth = 1.0f )

draws a wireframe rectangle in "rect" in specified color and optional line width

◆ dglDrawRectFill() [1/2]

void dglDrawRectFill ( const Point2I & upperL,
const Point2I & lowerR,
const ColorI & color )

draws an UNTEXTURED filled rectangle from upperL to lowerR in specified color

◆ dglDrawRectFill() [2/2]

void dglDrawRectFill ( const RectI & rect,
const ColorI & color )

draws an UNTEXTURED filled rectangle in "rect" in specified color

◆ dglDrawTriangleFill()

void dglDrawTriangleFill ( const Point2I & pt1,
const Point2I & pt2,
const Point2I & pt3,
const ColorI & color )

draws an UNTEXTURED filled triangle with the three points which should be given in counterclockwise order

◆ dglSolidCube()

void dglSolidCube ( const Point3F & extent,
const Point3F & enter )

Draws a solid cube around "center" with size "extent".

◆ dglWireCube()

void dglWireCube ( const Point3F & extent,
const Point3F & center )

Draws a wireframe cube around "center" with size "extent".