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 - underww

Pages: 1 2 [3]
31
Graphics / Afterimages while fast scrolling screen
« on: January 08, 2014, 12:38:38 pm »
While scrolling the game screen, it isn't clear because of afterimages.

It is not a serious problem but, I want to fix this.

I guess this problem related with double buffering.

I'm already using vertical sync, but it doesn't help to fix this problem.

I'm using sf::View to scroll the screen.

Here's some sample code.

// view.move(0.f, 1.f); // this works well
// view.move(0.f, 2.f); // this works well too
view.move(0.f, 3.f); // the problem happens here

window.clear();
window.setView(view);
window.draw();
window.display();
 

Thanks :)

32
Graphics / Sprite draw problem. or bug?
« on: December 31, 2013, 12:29:43 pm »
I found sometimes SFML draw a sprite incorrectly on a particular position or in some cases.

For example, this code can't draw a sprite correctly.

I tested it on SFML 2.1 stable version and latest version also.

Here is the source code and the result screen.

        sf::RenderWindow window(sf::VideoMode(800, 600), "Test", sf::Style::Close);

        sf::Texture texture;
        texture.loadFromFile("texture.png");

        sf::Sprite sprite(texture);
        sprite.setPosition(16.49849838f, 16.49849838f);

        sf::Sprite sprite2(texture);
        sprite2.setPosition(16.5f, 50.f);

        sf::Sprite sprite3(texture);
        sprite3.setPosition(16.f, 85.f);

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear();
                window.draw(sprite);
                window.draw(sprite2);
                window.draw(sprite3);
                window.display();
        }
 




Only third one draw normally.

Actually it can avoid using just integer position.

But, when I draw an animation like this ( move(velocity * dt.asSeconds(); )

SFML will draw an incorrect image a while.

Also sf::Font looks have the same problem.

33
Graphics / Re: Change sprites color problem.
« on: November 29, 2013, 04:23:33 pm »
Thanks for replying so quickly.

but another problem is that the sprite has alpha channel.

so, white semi-transparent rectangle makes background also white.

how can I handle this issue?

34
Graphics / Change sprites color problem.
« on: November 29, 2013, 03:54:12 pm »
I'm trying to make short white blink effect as a result of collisions.

but I can't change sprite's color to white because white color is default color on sprite class.

so, is there any solution for this problem?

Thanks and I'm sorry for my poor English, I hope you understand my question.

Pages: 1 2 [3]