var DMELayer = {}; DMELayer.new = func(group,name,controller=nil) { var m=Layer.new(group, name, DMEModel, controller); m.setDraw (func draw_layer(layer:m, callback: draw_dme, lod:0) ); return m; } register_layer("dme", DMELayer);