Game Development Community

extending t2dSceneObject

by Bret Patterson · in iTorque 2D · 09/08/2009 (10:47 am) · 2 replies

Let's say I wanted to extend t2dSceneObject for my native extensions instead of using Components. How would I use the level editor to drag and drop these new objects. IE I want to extend t2dAnimatedSprite and add custom collision, update processing etc but I want to still be able to drag and drop it onto the editor.

#1
09/08/2009 (12:54 pm)
This is just a guess since I haven't tried it, but do your custom classes show up if you build them in the Torque Game Builder project instead of just building it within TGBGame?
#2
09/08/2009 (1:04 pm)
Well the classes cat be built into the Editor, but I'm not sure how you drag and drop an Animated sprite from the editor into the scene and then specify the C++ class they actually are.

It's generally NOT a good idea to build your classes into the editor because it causes them to exhibit their in game behavior inside the editors scenegraph (at least my behaviors did). IE all my adornments I created in the class showed up in the editor and got serialized to the level. This causes things like double adornments etc.