# 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_fix = nil; var text_fix = nil; # add the draw routine from airports-nd.draw here var draw = func { if (me.icon_fix != nil) return; 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(0,0.6,0.85) .setStrokeLineWidth(3); 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(0,0.6,0.85) .setFontSize(28); #me.element.setGeoPosition(lat, lon) # .set("z-index",1); # FIXME: this needs to be configurable!! # disabled: if(0) { # the fix symbol me.icon_fix = me.element.createChild("path") .moveTo(-15,15) .lineTo(0,-15) .lineTo(15,15) .close() .setStrokeLineWidth(3) .setColor(0,0.6,0.85) .setScale(0.5,0.5); # FIXME: do proper LOD handling here - we need to scale according to current texture dimensions vs. original/design dimensions # the fix label me.text_fix = me.element.createChild("text") .setDrawMode( canvas.Text.TEXT ) .setText(me.model.id) .setFont("LiberationFonts/LiberationSans-Regular.ttf") .setFontSize(28) .setTranslation(5,25); } };