ARSA Language  2.8
(Encryption, GPU and Web 3.0)
draw Class Reference

#include <primitives.h>

Public Member Functions

void pixel (int x, int y, int thickness=1, int r=255, int g=255, int b=255, int a=255)
 Draws a pixel. More...
 
void line (int x1, int y1, int x2, int y2, int thickness=1, int r=255, int g=255, int b=255, int a=255)
 Draws a 2d line. More...
 
void rect (int x1, int y1, int x2, int y2, int thickness=1, bool fill=false, int r=255, int g=255, int b=255, int a=255)
 Draws a 2d rectangle. More...
 
void poly (int cx, int cy, int radius=10, int vertexCount=10, bool fill=false, int start_percent=0, int end_percent=100, const char *texture_name=0, int r=255, int g=255, int b=255, int a=255)
 Draws a non filled concyclic regular 2d polygon. More...
 
void circle (int cx, int cy, int radius=10, int r=255, int g=255, int b=255, int a=255)
 Draws a non filled 2d circle. this's macro of poly() More...
 
void cross (int cx, int cy, int length=5, int thickness=1, int r=255, int g=255, int b=255, int a=255)
 Draws a cross. this's macro of line() More...
 
void plus (int cx, int cy, int length=5, int thickness=1, int r=255, int g=255, int b=255, int a=255)
 Draws a plus. this's macro of line() More...
 

Detailed Description

Definition at line 38 of file primitives.h.

Member Function Documentation

◆ circle()

void draw::circle ( int  cx,
int  cy,
int  radius = 10,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a non filled 2d circle. this's macro of poly()

Parameters
cx,cycenter position of circle (pixels).
radiusradius of circle in pixels.
r,g,b,aColor of the line to draw.

◆ cross()

void draw::cross ( int  cx,
int  cy,
int  length = 5,
int  thickness = 1,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a cross. this's macro of line()

Parameters
cx,cyCenter Position of cross (pixels).
lengthof line in cross shape.
thicknesssize of elements.
r,g,b,aColor of the line to draw.

◆ line()

void draw::line ( int  x1,
int  y1,
int  x2,
int  y2,
int  thickness = 1,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a 2d line.

In theory both start and end will be included in coloring. BUG: Currently hardware drivers (d3d/opengl) ignore the last pixel (they use the so called "diamond exit rule" for drawing lines).

Parameters
x1,y1Start screen coordinates of the start of the line in pixels.
x2,y2End screen coordinates of the start of the line in pixels.
thicknesssize of elements.
r,g,b,aColor of the line to draw.

◆ pixel()

void draw::pixel ( int  x,
int  y,
int  thickness = 1,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a pixel.

Parameters
xThe x-position of the pixel.
yThe y-position of the pixel.
thicknesssize of elements.
r,g,b,aColor of the pixel to draw.

◆ plus()

void draw::plus ( int  cx,
int  cy,
int  length = 5,
int  thickness = 1,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a plus. this's macro of line()

Parameters
cx,cyCenter Position of plus (pixels).
lengthof line in plus shape.
thicknesssize of elements.
r,g,b,aColor of the line to draw.

◆ poly()

void draw::poly ( int  cx,
int  cy,
int  radius = 10,
int  vertexCount = 10,
bool  fill = false,
int  start_percent = 0,
int  end_percent = 100,
const char *  texture_name = 0,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a non filled concyclic regular 2d polygon.

This method can be used to draw circles, but also triangles, tetragons, pentagons, hexagons, heptagons, octagons, enneagons, decagons, hendecagons, dodecagon, triskaidecagons, etc. I think you'll got it now. And all this by simply specifying the vertex count. Welcome to the wonders of geometry.

Parameters
cx,cyCenter Position of center of circle (pixels).
radiusRadius of circle in pixels.
vertexCountAmount of vertices of the polygon. Specify 2 to draw a line, 3 to draw a triangle, 4 for tetragons and a lot (>10) for nearly a circle.
fillFill the rectangle with color.
start_percentstart draw polygon percent [0..100], start at bottom center.
end_percentend draw polygon percent [0..100], end at bottom center.
texture_nameshow texture inside polygon, image filename or layername in psd. NOTE: fill must true.
r,g,b,aColor of the line to draw.

◆ rect()

void draw::rect ( int  x1,
int  y1,
int  x2,
int  y2,
int  thickness = 1,
bool  fill = false,
int  r = 255,
int  g = 255,
int  b = 255,
int  a = 255 
)

Draws a 2d rectangle.

Parameters
x1,y1Top-Left position of the rectangle.
x2,y2Bottom-Right position of the rectangle.
thicknesssize of elements.
fillFill the rectangle with color.
r,g,b,aColor of the line to draw.

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