Drawing

You can use basic drawing calls directly in SCL™. These calls are intentionally similar to native canvas calls but not all calls are supported. You can draw onto sprites, onto the bottom of the canvas, or on top of the canvas overtop of all sprites.

You draw inside a routine. For example:

create routine as DrawBackground draw onto _bottom fillstyle "rgba(255,0,255,0.65)" fillrect 430,140,40,40 filltext "Hello",10,10,100 enddraw end

Draw command are all small-case, followed by a space, then parameters separated by commas. Strings for text or CSS styles must be double-quoted. The above example demonstrates this. Please also visit W3 to get the list of valid parameters for the support calls.

Warning: expressions are have only experimentally supported in draw commands because of performance considerations.
Support will be coming soon.

Drawing onto _bottom will draw on the canvas before any sprites are drawn.

Drawing onto _top will draw on top of everything after everything else is drawn.

Drawing onto a sprite (specified with its name) will draw onto the sprite with all the sprites alterations applied to the drawing. That means, by drawing on sprites, you create mini-canvases for drawing.

Drawing is sticky. Once you draw on a sprite or onto _bottom or _top, that drawing stays until it is cleared with "clear".

You are strongly advised to read the W3 drawing specification

Supported calls are:

Read the W3 drawing specification for details but be aware of some basics with SCL™: