| 
    JNGL
    
   Easy to use cross-platform 2D game library 
   | 
 
Functions for drawing shapes. More...
Go to the source code of this file.
Namespaces | |
| namespace | jngl | 
| JNGL's main namespace.  | |
Functions | |
| void | setColor (Rgb) | 
| Sets the color which should be used to draw primitives.   | |
| void | setColor (Rgba) | 
| Sets the color (including alpha) which should be used to draw primitives.  | |
| void | setColor (Rgb, unsigned char alpha) | 
| Sets the color and alpha which should be used to draw primitives.   | |
| void | setColor (unsigned char red, unsigned char green, unsigned char blue) | 
| void | setColor (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) | 
| void | setAlpha (uint8_t alpha) | 
| Sets the alpha value which should be used to draw primitives (0 = fully transparent, 255 = fully opaque)  | |
| void | pushAlpha (unsigned char alpha) | 
| void | popAlpha () | 
| void | setLineWidth (float width) | 
| void | drawLine (Vec2 start, Vec2 end) | 
| Draws a line from start to end, the width can be set using setLineWidth.   | |
| void | drawLine (Vec2 start, Vec2 end, float lineWidth) | 
| Draws a line from start to end with width lineWidth in the color set by jngl::setColor.  | |
| void | drawLine (Vec2 start, Vec2 end, float lineWidth, Rgba color) | 
| Draws a line from start to end with width lineWidth in color.  | |
| void | drawLine (double xstart, double ystart, double xend, double yend) | 
| void | drawLine (Mat3 modelview, Vec2 start, Vec2 end) | 
| Draws a line from start to end.   | |
| void | drawLine (Mat3 modelview, Vec2 start, Vec2 end, float lineWidth) | 
| Draws a line from start to end with width lineWidth in the color set by jngl::setColor.  | |
| void | drawLine (Mat3 modelview, Vec2 start, Vec2 end, float lineWidth, Rgba color) | 
| Draws a line from start to end with width lineWidth in color.  | |
| void | drawLine (const Mat3 &modelview, Vec2 end) | 
| Draws a line from (0, 0) to end in the color set by jngl::setColor.   | |
| void | drawLine (const Mat3 &modelview, Vec2 end, Rgba color) | 
| Draws a line from (0, 0) to end in color.   | |
| void | drawLine (Mat3 modelview, Vec2 end, float lineWidth, Rgba color) | 
| Draws a line from (0, 0) to end with width lineWidth in color.  | |
| void | drawEllipse (float xmid, float ymid, float width, float height, float startAngle=0) | 
| void | drawEllipse (Vec2, float width, float height, float startAngle=0) | 
| void | drawEllipse (Mat3 modelview, float width, float height, float startAngle=0) | 
| void | drawEllipse (Mat3 modelview, float width, float height, float startAngle, Rgba color) | 
| void | drawCircle (Vec2, float radius, float startAngle=0) | 
| Angles in radian.  | |
| void | drawCircle (Mat3 modelview, float radius, float startAngle) | 
| void | drawCircle (Mat3 modelview, float radius, float startAngle, Rgba color) | 
| Draws a circle at (0, 0) with radius in color with startAngle cut out.   | |
| void | drawCircle (Mat3 modelview, float radius) | 
| void | drawCircle (Mat3 modelview, float radius, Rgba color) | 
| Draws a circle at (0, 0) with radius in color.  | |
| void | drawCircle (Mat3 modelview, Rgba color) | 
| Draws a circle at (0, 0) with radius of 1 in color.  | |
| void | drawPoint (double x, double y) | 
| void | drawTriangle (Vec2 a, Vec2 b, Vec2 c) | 
| Draws the triangle a -> b -> c.  | |
| void | drawTriangle (double A_x, double A_y, double B_x, double B_y, double C_x, double C_y) | 
| void | drawTriangle (Mat3 modelview, Rgba color) | 
| Draws a equilateral triangle centered at (0, 0) and the top point at (0, 1)   | |
| void | drawRect (double xposition, double yposition, double width, double height) | 
| Draws a rectangle at { xposition, yposition }.   | |
| void | drawRect (Vec2 position, Vec2 size) | 
| Draws a rectangle at position.   | |
| void | drawRect (const Mat3 &modelview, Vec2 size, Rgb) | 
| Draws a rectangle spawning from (0, 0) to (size.x, size.y) with the specified color.   | |
| void | drawRect (Mat3 modelview, Vec2 size, Rgba color) | 
| Draws a rectangle spawning from (0, 0) to (size.x, size.y) with the specified color.   | |
| void | drawRectOutline (Mat3 modelview, Vec2 size, float lineWidth, Rgba color) | 
| Draws the outline of a rectangle (so □ instead of ■) of size centered at (0, 0) in color.  | |
| void | drawSquare (const Mat3 &modelview, Rgba color) | 
| Draws a (filled) square of size 1x1 centered at (0, 0) with the specified color.   | |
| void | drawSquareOutline (Mat3 modelview, float lineWidth, Rgba color) | 
| Draws the outline of a square (so □ instead of ■) of size 1x1 centered at (0, 0) with the specified color.   | |
| template<class Vect > | |
| void | drawRect (Vect pos, Vect size) | 
Functions for drawing shapes.
Definition in file shapes.hpp.