I'm attempting to recreate Space Invaders using SFML and I'm currently working on the menu.
I wanted to add two sprites to the menu but I'm having lots of problems trying to get the sprites into position.
This is the code I'm using to create one of the sprites as well as set it's position and origin (I commented out the other sprite for testing reasons):
invader2 = new MenuInvader();
invader2->setScale(5.0f, 5.0f);
invader2->setOrigin(invader2->getGlobalBounds().width / 2, invader2->getGlobalBounds().height / 2);
invader2->setPosition(window->getSize().x / 2, window->getSize().y / 2);This is what it looks like in Game:
For some reason the sprite is far off the screen and the only way I can fix this is by scaling the sprite back down to it's original size but even if I do that, there is still this strange offset from the centre of the screen which is where I want the sprite to be:
Does anyone know what's going on?