ARSA Language
2.8
(Encryption, GPU and Web 3.0)
|
#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... | |
Definition at line 38 of file primitives.h.
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()
cx,cy | center position of circle (pixels). |
radius | radius of circle in pixels. |
r,g,b,a | Color of the line to draw. |
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()
cx,cy | Center Position of cross (pixels). |
length | of line in cross shape. |
thickness | size of elements. |
r,g,b,a | Color of the line to draw. |
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).
x1,y1 | Start screen coordinates of the start of the line in pixels. |
x2,y2 | End screen coordinates of the start of the line in pixels. |
thickness | size of elements. |
r,g,b,a | Color of the line to draw. |
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.
x | The x-position of the pixel. |
y | The y-position of the pixel. |
thickness | size of elements. |
r,g,b,a | Color of the pixel to draw. |
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()
cx,cy | Center Position of plus (pixels). |
length | of line in plus shape. |
thickness | size of elements. |
r,g,b,a | Color of the line to draw. |
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.
cx,cy | Center Position of center of circle (pixels). |
radius | Radius of circle in pixels. |
vertexCount | Amount 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. |
fill | Fill the rectangle with color. |
start_percent | start draw polygon percent [0..100], start at bottom center. |
end_percent | end draw polygon percent [0..100], end at bottom center. |
texture_name | show texture inside polygon, image filename or layername in psd. NOTE: fill must true. |
r,g,b,a | Color of the line to draw. |
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.
x1,y1 | Top-Left position of the rectangle. |
x2,y2 | Bottom-Right position of the rectangle. |
thickness | size of elements. |
fill | Fill the rectangle with color. |
r,g,b,a | Color of the line to draw. |