Talk:How to manipulate Canvas elements: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (untested)
Line 24: Line 24:
}
}


<syntaxhighlight>  
</syntaxhighlight>  
--~~~~
--[[User:Hooray|Hooray]] ([[User talk:Hooray|talk]]) 14:50, 5 December 2017 (EST)

Revision as of 19:50, 5 December 2017

named arguments in examples ?

Hi there, fantastic job ! May I suggest that we use named function arguments, i.e. in the form:

var foo = func(altitude, label) {
}


foo(altitude:100, label:"hello world");

I feel that this would help make the code more self-explanatory, what do you think ? --Hooray (talk) 14:21, 5 December 2017 (EST)

plot2D namespace detection

I think, the following should work:

if (!canvas['plot2D']) {
 var root = getprop("/sim/fg-root");
 io.load_nasal( root ~ '/Nasal/plot2D.nas', "canvas" );
}

--Hooray (talk) 14:50, 5 December 2017 (EST)