typegraph/scripts/blocks/blockFromTemplate.gml

20 lines
401 B
Plaintext
Raw Permalink Normal View History

///blockFromTemplate(template)
/**
* blockFromTemplate :: BlockTemplate -> Instance
*
* Creates a block from the given template.
*
* @param template the block tempalte to use
* @returns the id of the block instance
*/
var template = argument0;
assertInstanceof(template, BlockTemplate);
var block = createBlock(template.inputs, template.outputs);
block.template = template;
return block;