Forum Discussion
EnTerr
10 years agoRoku Guru
"TheEndless" wrote:
As far as I'm aware, you still have to have an XML file that defines the component, otherwise SceneGraph won't be able to find the component you're trying to create. I don't think there's any way to register a component with SceneGraph via code.
You mean if i want to "extend" an existing component?! I don't want to do that... why would i?
I don't want to sub-class existing nodes, i am not writing a future-reuse library - i am happy to use off-the-shelf "as-is" nodes. All i want is to instantiate and populate them programmatically, then use them! I can do that with the children, can do that for the attributes and all i seem to miss is the functions/script, right?
... specific init() and onKeyEvent() functions. Note that those are not methods on the component itself, but rather intrinsic event handler functions.
tOmato, tomAto - it's a question of what you name them. Event handlers which are functions that get invoked by magic-name... call them methods or not, it would be best they get accessible name slots in the node, so they can be assigned to or called directly... no?