# See: http://wiki.flightgear.org/MapStructure # Class things: var name = 'APT'; var parents = [DotSym]; var __self__ = caller(0)[0]; DotSym.makeinstance( name, __self__ ); var element_type = "group"; # we want a group, becomes "me.element" var icon_apt = nil; var text_apt = nil; # add the draw routine from airports-nd.draw here var init = func { var icon_apt = me.element.createChild("path", name ~ " icon" ) .moveTo(-17,0) .arcSmallCW(17,17,0,34,0) .arcSmallCW(17,17,0,-34,0) .close() .setColor(me.layer.style.color_default) .setStrokeLineWidth(me.layer.style.line_width); var text_apt = me.element.createChild("text", name ~ " label") .setDrawMode( canvas.Text.TEXT ) .setTranslation(17,35) .setText(me.model.id) .setFont("LiberationFonts/LiberationSans-Regular.ttf") .setColor(me.layer.style.label_font_color) .setFontSize(me.layer.style.label_font_size); # FIXME: this applies scale to the whole group, better do this separately for each element? me.element.setScale(me.layer.style.scale_factor); }; var draw = func;