20,741
edits
m (→Base Package) |
|||
| Line 12: | Line 12: | ||
## | ## | ||
# constructor | # constructor | ||
new: func( | new: func(view=0, width=640,height=480) { | ||
var m = { parents: [myElementTest] }; | var m = { parents: [myElementTest] }; | ||
m.dlg = canvas.Window.new([ | m.dlg = canvas.Window.new([width,height],"dialog"); | ||
m.canvas = m.dlg.createCanvas().setColorBackground(1,1,1,1); | m.canvas = m.dlg.createCanvas().setColorBackground(1,1,1,1); | ||
m.root = m.canvas.createGroup(); | m.root = m.canvas.createGroup(); | ||
| Line 29: | Line 29: | ||
var test = myElementTest.new(); | var test = myElementTest.new(); | ||
var cameras = [ | |||
{view: 0, width : 640, height: 480}, | |||
{view: 1, width : 640, height: 480}, | |||
{view: 2, width : 640, height: 480}, | |||
]; | |||
foreach(var cam; camers) { | |||
var newCam = myElementTest.new( view: cam.view, width: cam.width, height: cam.height ); | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||