Hello,

I'm currently working on a simple SFML game using its 2D library.

Here's the part of the code the problem is coming from:

data.SetCenter(data.GetSize() / 2.0F);
data.Resize(50,50);
data.SetColor(sf::Color(255,255,255));

If I remove the call to SetCenter, the square shows up fine.
But when I add the call to SetCenter, the square isn't visible.

Help?

Um, help anyone?

I don't know much about SFML, but if you are changing the center (I am guessing thats the same thing as an origin), it is essentially changing location of where the square is draw relative to it's position. You should try repositioning the square relative to the new center.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.