[ Back ]
For safety and compability reasons, NaaLaa uses only software routines for all drawing operations.
procedure load image image_id, filename$
procedure save image image_id, filename$
procedure create image image_id, w, h
procedure free image image_id
procedure set image colorkey image_id, value
procedure set image image_id
procedure draw image image_id, x, y
procedure draw image image_id, x, y, srx_x, srx_y, src_w, src_h
procedure draw image image_id, x, y, cel
procedure set image grid image_id, c, r
procedure draw hraster image_id, y, x_start, x_end, u_start#, v_start#, u_end#, v_end#
procedure draw vraster image_id, x, y_start, y_end, u_start#, v_start#, u_end#, v_end#
Load filename to image image_id. Supported file formats are JPG, PNG (24 and 32 bit), TGA, BMP (not RLE) and GIF.
Save image image_id to filename (only bmp).
Create image image_id and set its width and height to w and h.
Free image image_id. All images are automaticly freed when program exits.
Returns true if image image_id exists.
Make all occurences of pure magenta (RGB: 255, 0, 255) transparent when drawing image image_id if value is set to true. An image can only have one color key.
Set destination image for all drawing operations to image_id. By default drawing is done to the primary image (the window's back buffer). You should therefor always pass primary as image_id when you're done drawing to another image.
Draw image image_id at x, y.
Draw part of image image_id, defined by the position src_x, src_y and the width and height src_w, src_h, to x, y.
Draw cel of image image_id at x, y. See set image grid.
Create a grid of c columns and r rows for image image_id. The above version of draw image can then be used to draw a certain cel of the image. Cels are indexed row by row starting with 0.
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 ]