2014-04-29 02:26:32 +00:00
|
|
|
# See: http://wiki.flightgear.org/MapStructure
|
2014-01-10 03:04:36 +00:00
|
|
|
# Class things:
|
|
|
|
var name = 'FIX';
|
|
|
|
var parents = [DotSym];
|
|
|
|
var __self__ = caller(0)[0];
|
|
|
|
DotSym.makeinstance( name, __self__ );
|
|
|
|
|
2014-05-25 18:11:13 +00:00
|
|
|
SymbolLayer.get(name).df_style = {
|
|
|
|
line_width: 3,
|
|
|
|
scale_factor: 1,
|
|
|
|
font: "LiberationFonts/LiberationSans-Regular.ttf",
|
|
|
|
font_color: [0,0,0],
|
|
|
|
font_size: 28,
|
|
|
|
color: [0, 0.6, 0.85],
|
|
|
|
show_labels: 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-01-10 03:04:36 +00:00
|
|
|
var element_type = "group"; # we want a group, becomes "me.element"
|
|
|
|
|
2014-04-29 02:26:32 +00:00
|
|
|
##
|
|
|
|
# used during initialization to populate the symbol cache with a FIX symbol
|
|
|
|
#
|
2014-05-25 18:11:13 +00:00
|
|
|
var drawFIX = func(group) {
|
|
|
|
group.createChild("path")
|
2014-01-10 03:04:36 +00:00
|
|
|
.moveTo(-15,15)
|
|
|
|
.lineTo(0,-15)
|
|
|
|
.lineTo(15,15)
|
|
|
|
.close()
|
2014-05-25 18:11:13 +00:00
|
|
|
.setStrokeLineWidth(line_width)
|
|
|
|
.setColor(color);
|
2014-04-29 02:26:32 +00:00
|
|
|
}
|
|
|
|
|
2014-05-25 18:11:13 +00:00
|
|
|
var cache = StyleableCacheable.new(
|
|
|
|
name:name, draw_func: drawFIX,
|
|
|
|
cache: SymbolCache32x32,
|
|
|
|
draw_mode: SymbolCache.DRAW_CENTERED,
|
|
|
|
relevant_keys: ["line_width", "color"],
|
|
|
|
);
|
2014-04-29 02:26:32 +00:00
|
|
|
|
2014-05-25 18:11:13 +00:00
|
|
|
var init = func {
|
|
|
|
# initialize the cached fix symbol
|
|
|
|
cache.render(me.element, me.style).setScale(me.style.scale_factor);
|
2014-04-29 02:26:32 +00:00
|
|
|
|
2014-05-25 18:11:13 +00:00
|
|
|
# non-cached stuff:
|
|
|
|
if (me.style.show_labels)
|
|
|
|
me.text_fix = me.newText(me.model.id).setScale(me.style.scale_factor);
|
2014-04-29 02:26:32 +00:00
|
|
|
}
|
2014-05-25 18:11:13 +00:00
|
|
|
var draw = func;
|