7ca8482b07
In time for 3.0. The API is still not fully complete, and not fully cleaned up, but this is good enough for this release cycle (and it should offer benefit longer term, if not now -- hopefully performance as well). Many thanks to Hooray as well, who has helped prepare things while I could not, and often suggested ideas.
34 lines
728 B
Text
34 lines
728 B
Text
# Class things:
|
|
var name = 'WPT';
|
|
var parents = [DotSym];
|
|
var __self__ = caller(0)[0];
|
|
DotSym.makeinstance( name, __self__ );
|
|
|
|
var element_type = "group"; # we want a group, becomes "me.element"
|
|
var base = nil;
|
|
var text_wps = nil;
|
|
|
|
var draw = func {
|
|
if (me.base != nil) return;
|
|
me.base = me.element.createChild("path")
|
|
.setStrokeLineWidth(3)
|
|
.moveTo(0,-25)
|
|
.lineTo(-5,-5)
|
|
.lineTo(-25,0)
|
|
.lineTo(-5,5)
|
|
.lineTo(0,25)
|
|
.lineTo(5,5)
|
|
.lineTo(25,0)
|
|
.lineTo(5,-5)
|
|
.setColor(1,1,1)
|
|
.close();
|
|
|
|
me.text_wps = wpt_grp.createChild("text")
|
|
.setDrawMode( canvas.Text.TEXT )
|
|
.setText(name)
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
|
.setFontSize(28)
|
|
.setTranslation(25,35)
|
|
.setColor(1,0,1);
|
|
};
|
|
|