Hey, Yeah sorry I didn't realize how vague my last question was. Basically I want to create an editor that will allow you to create boxes I.E.(Crates, bricks) and after you put everything in your level you will be able to play it.
So how I was thinking of doing it was in my Box or "crate" class and here is a quick example of what they look like:
void GameObject::Initialize(b2World* world)
{
dbSprite(m_boxID,0,0,m_spriteID);
dbOffsetSprite(m_boxID,dbSpriteWidth(m_boxID)/2,dbSpriteHeight(m_boxID)/2);
dbScaleSprite(m_boxID,m_scale);
}
void GameObject::Update()
{
m_angle = p_body->GetAngle();
m_position = p_body->GetPosition();
m_position.x *= b2PixelRatio;
m_position.y *= b2PixelRatio;
m_angle *= (180.0 / 3.141592653589793238);
dbSprite(m_boxID,m_position.x,m_position.y,m_spriteID);
dbPasteSprite(m_boxID,m_position.x,m_position.y);
dbRotateSprite(m_boxID, m_angle);
dbText(5,5,dbStr(m_position.x));
dbText(5,20,dbStr(m_position.y));
}
As you can see right now I am using the dbSprite function still which is what my content manager will replace.
So when I call the NewSprite function in my content manager I take the name of the Image and then I make a name for the sprite. So every time I create a new crate/box for instance I have it right now that I specify a new name. With the editor I need it to dynamically change the name of the sprite so it would be more like, "crate01" and then "crate02" without me haveing to actually hard code the names.
Not to sure if that makes more since. I could just be confusing you with bad programming. I'm still a little new to it all but I guess I have to start some where =).