Game Development Community

1.5 bug. (?). creating new objects

by rennie moffat · in iTorque 2D · 10/25/2011 (9:27 am) · 2 replies

Is there an issue with creating new objects in 1.5?



I ask because I am running a script, which I made two versions of, both echoes lead up to the point of creation, but nothing appears and console says it can not find item.


%this.sldr0 = new t2dStaticSprite(sldr0) {
         imageMap = "dPadPadImageMap";
         frame = "0";
         mUseSourceRect = "0";
         sourceRect = "0 0 0 0";
         canSaveDynamicFields = "1";
         PlatformTarget = "UNIVERSAL";
         Position = "89.162 -335.609";
         size = "47.264 47.264";
         CollisionPhysicsSend = "0";
         CollisionPhysicsReceive = "0";
         CollisionMaxIterations = "3";
         AlphaTestValue = "-1";
         UsesPhysics = "1";
         AutoMassInertia = "0";
         Mass = "22.339";
         Inertia = "8317.17";
         LinearVelocity = "0.000 50.000";
            mountID = "3";
         _behavior0 = "";
      };

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
10/25/2011 (11:45 am)
Are you creating this object dynamically at runtime? I actually ran into this same problem myself a while back. For dynamically created objects, you have to set the scenegraph on the object before it'll show up.
#2
10/25/2011 (1:14 pm)
Oh snap!

I bet that was it.


Forgot. Thanks.