Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite apears as a white box.  (Read 1274 times)

0 Members and 3 Guests are viewing this topic.

Musi

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprite apears as a white box.
« 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 );

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Sprite apears as a white box.
« Reply #1 on: June 23, 2013, 01:40:15 pm »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Musi

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprite apears as a white box.
« Reply #2 on: June 23, 2013, 01:44:34 pm »
Ah thank you