Box2D Forums

It is currently Tue May 21, 2013 10:50 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Mar 26, 2012 5:09 am 
Offline

Joined: Thu Feb 23, 2012 4:22 am
Posts: 8
Sorry to ask this co'z after several hours of googling but up to this time had no luck. Ok successfully added a body in a world i created but I do not know how to set it's initial position.
Here is the code
Code:
Code:
package {

   import Box2DAS.*;
   import Box2DAS.Collision.*;
   import Box2DAS.Collision.Shapes.*;
   import Box2DAS.Common.*;
   import Box2DAS.Dynamics.*;
   import Box2DAS.Dynamics.Contacts.*;
   import Box2DAS.Dynamics.Joints.*;
   import cmodule.Box2D.*;
   import wck.*;
   import shapes.*;
   import misc.*;
   import extras.*;
   import flash.utils.*;
   import flash.events.*;
   import flash.display.*;
   import flash.text.*;
   import flash.geom.*;

   public class World extends wck.World {
     
      public function World() {
         var c:BodyShape = new Bilog();

         /* tried this but got an error*?
         c.setX(10);
         c.setY(10);

         addChild(c);

       }
   }
}


Thanks!


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 6:26 am 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
This should work:
Code:
c.x = 10; c.y = 10;

Not sure what your setX/setY is about. Also what's the error?


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 11:04 pm 
Offline

Joined: Thu Feb 23, 2012 4:22 am
Posts: 8
yay! thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group