Register Interface
Interface where you can interact with nodes created in Blackprint Engine.
Interface?
Node element registration
Register new node interface type
// Blackprint.registerInterface("interface/name", options, newScope)
// Template already defined in window.templates['Blackprint/nodes/default']
Blackprint.registerInterface('Blackprint/nodes/default', {
// `iface` will extend from Blackprint.Node (Optional)
extend: Blackprint.Node,
}, function(iface){
// iface = ScarletsFrame component handler (that control the HTML element)
// If the element would have value that can be exported to JSON
// It must being set inside options object
iface.options = {};
// Run after this component was initialized
iface.init = function(){
// You can use it like jQuery
iface.$el('.button').on('click', function(ev){
// We call the node handler that using this component
// `node` from Blackprint.registerNode('', (node, iface) => {})
iface.node.onclicked(ev);
});
}
});Last updated