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

Pages: [1]
1
Graphics / Blurred image
« on: September 28, 2010, 08:55:16 pm »
Quote from: "kaikimi"
SetSmooth(false) on every sf::Image.

I had the same "problem" too when staring out.


Thank you! :)

2
Graphics / Blurred image
« on: September 28, 2010, 06:04:01 pm »
Hi!
I'm a beginner and I've problem: my image is blurred!

Here's my code:
Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics", 0);

    // Load the sprite image from a file
    sf::Image Image;
    if (!Image.LoadFromFile("bg.bmp"))
        return EXIT_FAILURE;

    // Create the sprite
    sf::Sprite Sprite(Image);
    Sprite.Resize(800, 600);

/*
    // Change its properties
    Sprite.SetColor(sf::Color(255, 255, 255));
    //Sprite.SetPosition(1.f, 1.f);
    Sprite.SetScale(1.f, 1.f);
*/

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Get elapsed time
        float ElapsedTime = App.GetFrameTime();

        // Move the sprite
        /*
        if (App.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move( 100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Sprite.Move(0, -100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Sprite.Move(0,  100 * ElapsedTime);

        // Rotate the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Add))      Sprite.Rotate(- 100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Subtract)) Sprite.Rotate(+ 100 * ElapsedTime);
*/
        // Clear screen
        App.Clear();

        // Display sprite in our window
        App.Draw(Sprite);

        // Display window contents on screen
        App.Display();

    }
system("PAUSE");
    return EXIT_SUCCESS;
}

I'm didn't change size of image. So what I'm doing wrong?

3
Graphics / Button
« on: September 22, 2010, 06:45:13 pm »
Quote from: "Lupinius"
What exactly is the problem?


I don't know how to make this.

4
Graphics / Button
« on: September 22, 2010, 04:29:23 pm »
Hello!
I'm trying to make graphical button (I read tutorials and I tested samples).

Here is my image:


Code example:

Quote
If you click left mouse button and mouse cursor X pos is 100-218 and Y pos is 100-161
{
do something
}



Can someone help? Thanks! :)

Pages: [1]
anything