Namespaces for Objects
by Till Hoffmann · in Torque Game Engine · 11/14/2005 (9:24 am) · 3 replies
Hello,
I've got another question:
You can implement new functions for datablocks by using the className field.
Is there any way to do this for objects (and not their datablocks).
I've got another question:
You can implement new functions for datablocks by using the className field.
Is there any way to do this for objects (and not their datablocks).
About the author
#2
But if I call %myObj.adjustPosition() the function is not found.
11/14/2005 (10:12 am)
Well, i used the following code:function CInventoryGuiItem::adjustPosition(%this)
{
...
}
%myObj = new GuiBitmapCtrl
{
classname = "CInventoryGuiItem";
};But if I call %myObj.adjustPosition() the function is not found.
#3
what is it you are attempting to do? if you only need to object specific functionality for guis theres a few less-elegant ways to realize this.
11/14/2005 (10:52 am)
Yeah i didnt really think that would work. without modifying the engine, Im pretty sure only datablocks can have namespace functions. what is it you are attempting to do? if you only need to object specific functionality for guis theres a few less-elegant ways to realize this.
Torque 3D Owner Sean H.
but this function gets implemented for all members of shapebase.
I also recall seeing someone using the classname attribute when instantiating an object using "new". I'm not sure if that's legal, but if it is then maybe you could use that for object namespace functions.