1
Graphics / Overlaying Images
« on: October 10, 2011, 03:15:25 am »
Nevermind, I figured out that all I had to do was image2.SetSmooth(false); which apparently stops the image from blurring itself in an attempt to look smoother.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
//Load images from file
sf::Image image, image2;
image.LoadFromFile("images/MainMenu.png");
image2.LoadFromFile("images/Background.png");
sf::Sprite sprite(image);
sf::Sprite sprite2(image2);
//Render
window.Clear();
window.Draw(sprite2);
window.Draw(sprite);
window.Display();
void SplashScreen::Show(sf::RenderWindow& window)
{
sf::Image splash;
if(splash.LoadFromFile("images/PongSplash.png") != true) //Check if it's valid, if not, skip over the splash screen completely.
return;
window.Close();
window.Create(sf::VideoMode(splash.GetWidth(), splash.GetHeight()), "Pong!");
sf::Sprite sprite(splash);
window.Draw(sprite);
window.Display();
//Code to loop and close screen here
}