Creating own TorqueObjects and adding them to TXB
by Dennis Sasse · in Torque X 2D · 07/26/2007 (5:48 am) · 2 replies
Hi Community,
i need a T2DSceneObject with some special functionalities that can be placed/manipulated in TXB but is not drawn in the game. I could just use a Blank Scene Object and then add Components for the functionality, but since i am developing the tools/components/scene objects that are used by other members of my team, i would prefer a single Scene Object that has all needed functionality already included. This way other people using the component wouldn't need to add any components to it and could just manipulate it's properties directly - like with the Spawner Objects.
Now i have two questions:
1) Is this a good idea after all? Is it advised to create my own Torque Objects for some special functionality, or is it better to just write Components and add them to existing Scene Objects? I have the functionality already implemented as Component, but i would really like to get rid of this one (in my regard) unnecessary step of adding a Blank Scene Object whose only purpose is to act as "container" for my Component.
2) If i would write my own T2DSceneObject, is there a way to make it appear in TXB, just as the Spawner Object and the Blank Scene Object? So far i have not found any documentation on this.
i need a T2DSceneObject with some special functionalities that can be placed/manipulated in TXB but is not drawn in the game. I could just use a Blank Scene Object and then add Components for the functionality, but since i am developing the tools/components/scene objects that are used by other members of my team, i would prefer a single Scene Object that has all needed functionality already included. This way other people using the component wouldn't need to add any components to it and could just manipulate it's properties directly - like with the Spawner Objects.
Now i have two questions:
1) Is this a good idea after all? Is it advised to create my own Torque Objects for some special functionality, or is it better to just write Components and add them to existing Scene Objects? I have the functionality already implemented as Component, but i would really like to get rid of this one (in my regard) unnecessary step of adding a Blank Scene Object whose only purpose is to act as "container" for my Component.
2) If i would write my own T2DSceneObject, is there a way to make it appear in TXB, just as the Spawner Object and the Blank Scene Object? So far i have not found any documentation on this.
#2
After all, it seems to be a rather intelligent and powerful approach ;)
07/28/2007 (5:23 am)
@Dan - Thank you for your reply! I figured that using components is the preferred way to go. I just wasn't sure to what extent and when it would make sense to think about creating own objects. After playing around some more with components and getting used to the idea of aggregation, i will keep using components. After all, it seems to be a rather intelligent and powerful approach ;)
Torque Owner Dan Maruschak