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

Show Posts

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.


Messages - tsarek

Pages: [1]
1
And more.
If the new picture is larger, sometimes around the sprites appear color artifacts.
It may be coincidence  to check the size of pictures in SetImage?

2
Hm, when paint in a loop of tiles of various sizes to better initialize the same sprite different picture than each time to create a new sprite.
Please, write in the docs, that the sprites have constant size.
I have long searched for the cause, has not yet looked for source of library.

3
Why?

Code: [Select]
////////////////////////////////////////////////////////////
/// Set the image of the sprite
////////////////////////////////////////////////////////////
void Sprite::SetImage(const Image& Img)
{
    // If there was no source image before, adjust the rectangle
    // if (!myImage)    TODO  comment this and all right
        SetSubRect(IntRect(0, 0, Img.GetWidth(), Img.GetHeight()));

    // Assign the new image
    myImage = &Img;
}

4
Sorry for the bad English.

Noticed a bug, when using void sf:: Sprite:: SetImage (const Image & Img).
Using SFML 1.3, openSuse 11.0, freeglut 060903-133.1, mesa 7.0.3-35.1, ati radeon 9660

If the previous sprite size is less than the new image size, the new image cropped to fit the sprite size.

Example:

Code: [Select]

sf::Image image1;
image.LoadFromFile( "image1.png" );
sf::Image image2;
image.LoadFromFile( "image2.png" ); // Size of image1 is less than size of image2

sf::Sprite sprite( image1 );
...
...
sprite.SetImage( image2 ); // Sprite size not change


Thanks for the SFML library.

Pages: [1]
anything