SFML community forums

Help => Graphics => Topic started by: Musi on June 23, 2013, 01:31:04 pm

Title: Sprite apears as a white box.
Post by: Musi on June 23, 2013, 01:31:04 pm
I've loaded a sprite from a file but for some reason when i draw it, it just appears as a white box the same size as the image. I load an image first so i can add an alpha mask, then load the texture, then the sprite.

    sf::Image image;
        image.loadFromFile("Sprites/cursorArrow.png");
        image.createMaskFromColor( sf::Color( 255,0,255 ) );

        sf::Texture texture;
        texture.loadFromImage( image );

        m_spriteArrow.setTexture( texture );
        m_spriteArrow.setPosition( 100.0, 100.0 );
Title: Re: Sprite apears as a white box.
Post by: eXpl0it3r on June 23, 2013, 01:40:15 pm
Official Tutorial - The white square problem (http://www.sfml-dev.org/tutorials/2.0/graphics-sprite.php#the-white-square-problem)
Wiki FAQ - Why do I get a white/black rectangle instead of my texture? (https://github.com/SFML/SFML/wiki/FAQ#why-do-i-get-a-whiteblack-rectangle-instead-of-my-texture)

:)
Title: Re: Sprite apears as a white box.
Post by: Musi on June 23, 2013, 01:44:34 pm
Ah thank you