Skip to main content

Class: ShapeDraw

Fluent host-drawing-tool placement. Finish with .draw(id, pane).

Properties are typed per value kind rather than taken as one untyped map, because AssemblyScript has no heterogeneous object literal to hand and a colour has to reach the wire as "#rrggbbtt" rather than as the i32 it is in a script.

Constructors​

Constructor​

new ShapeDraw(name): ShapeDraw

Parameters​

name​

string

Returns​

ShapeDraw

Methods​

bool()​

bool(key, v): ShapeDraw

A boolean property, e.g. .bool("extendRight", true).

Parameters​

key​

string

v​

bool

Returns​

ShapeDraw


color()​

color(key, c): ShapeDraw

A colour-valued property, e.g. .color("textColor", rgba(255, 0, 0)).

Parameters​

key​

string

c​

i32

Returns​

ShapeDraw


draw()​

draw(id?, pane?): void

Parameters​

id?​

string = ""

pane?​

string = ""

Returns​

void


num()​

num(key, v): ShapeDraw

A number-valued property, e.g. .num("lineWidth", 2).

Parameters​

key​

string

v​

f64

Returns​

ShapeDraw


point()​

point(time, price): ShapeDraw

Parameters​

time​

i64

price​

f64

Returns​

ShapeDraw


str()​

str(key, v): ShapeDraw

A text-valued property, e.g. .str("text", "supply").

Parameters​

key​

string

v​

string

Returns​

ShapeDraw