[ Back ]
NaaLaa doesn't have many primitive types for drawing, but hopefully you'll get around.
procedure draw line x0, y0, x1, y1
procedure draw pixel x, y
procedure set pixel x, y
procedure draw rect x, y, w, h[, fill]
procedure draw ellipse center_x, center_y, radius_x, radius_y[, fill]
procedure draw poly points[][, fill] / procedure draw polyf points#[][, fill]
procedure set color r, g, b[, a]
function pixel[](x, y)
procedure set colori c
function pixeli([image_id, ]x, y)
procedure set additive value
procedure hscroll dx
procedure vscroll dy
procedure scroll dx, dy
procedure set clip rect x, y, width, height
Draw line from x0, y0 to x1, y1.
Draw pixel at x, y.
Set pixel at x, y to current drawing color (see set color and set colori)
Draw rectangle of width w and height h with upper left corner at x, y. If fill is submitted and set to true, the rectangle is filled.
Draw ellipse centered at center_x, center_y with x and y radius radius_x, radius_y. If fill is submitted and set to true, the ellipse is filled.
Draw a polygon of the points in points. If the optional fill is supplied and set to true, the polygon will be filled. The format of the points should be [x1, y1, x2, y2, x3, y3, ...]. Ex:
draw poly [100, 100, 200, 100, 200, 200, 100, 200], true
, draws a filled rectangle.
Set color to r, g, b (RGB) or r, g, b, a (RGBA) if an alpha (transparency) value is submitted. This color will affect all drawing operation, including text output.
Return color at x, y as an integer array [r, g, b, a] (RGBA).
Set current drawing color to c. c is an integer containing one byte per color channel (in the RGBA format AARRGGBB). See pixeli for more information.
Get color as an integer (in the RGBA format AARRGGBB) at position x, y. If an image, image_id, is submitted, the pixel will be read from that image.
Use additive draw mode if value is set to true.
Scroll image dx steps horisontally.
Scroll image dy steps vertically.
Scroll image dx steps horisontally and dy steps vertically.
Set clipping rectangle for current image to position x, y and width and height w, h. Graphics wont be drawn outside of this rectangle.
Return number of cels in image image_id. See set image grid.
Return width (or cel width) of image image_id.
Return height (or cel height) of image image_id.
Draw a horizontal line from x_start, y to x_end, y. This line uses image image_id as a texture. The texture coordinates at x_start, y are u_start, v_start, and the texture coordinates at x_end, y are u_end, v_end. The texture coordinates are measured from the top left corner of image image_id, and they should be in the range 0..1 (where 1, 1 is the bottom right of the image).
This procedure does not handle transparency (alpha channel) of the source image, nor is it affected by the additive draw mode. Also, the color set with set color works as a "fog" on the texture. That is, if you use set color 255, 255, 255, 0, the texture will look as it does in the image image_id. But if you use set color 255, 255, 255, 255, the texture will be replaced by a solid white color.
Draw a vertical line from x, y_start to x, y_end. This line uses image image_id as a texture. The texture coordinates at x, y_start are u_start, v_start, and the texture coordinates at x, y_end are u_end, v_end. The texture coordinates are measured from the top left corner of image image_id, and they should be in the range 0..1 (where 1, 1 is the bottom right of the image).
For information about how set color affects this procedure, have a look at draw hraster.
[ Back ]