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

Pages: [1]
1
Graphics / Re: Image doesn't stand still
« on: January 10, 2017, 10:35:35 pm »
Thank you very much for your help.
Rhimlock i understood where i was wrong,your pseoudo helped me a lot.
Thank u eXpl0it3r,this is my first sfml code ,i ll learn from my mistakes.
U can T.C

2
Graphics / Re: Image doesn't stand still
« on: January 10, 2017, 02:57:09 pm »
The game simply works ,and the window also.
My problem is that "If the mouse just goes through a specific area,i want the image to change.
If then the mouse clicks,i also want the game to start.
 " doesnt work.
and i don t know why.
i ve read the tutorial,and i told u,the game works.
My problem is or with the mouse functions,or with the window display.
It s kinda flickering when mouse goes throug that specific pixels,the image doesnt permanently change(while cursor is there).

3
Graphics / Image doesn't stand still
« on: January 09, 2017, 10:52:50 pm »
I m trying to make a menu for a simple snake game.
I ve got 2 photos,one for the normal menu,and one for when the mouse goes through a particular area of a text from the menu(simple makes the text look different ).
The problem is that the image "vibrates" ,simply the first image wont change into second to enlighten the text,it will change just for very short time (0,1 ms 0,2 ms)

Also ,on click ,i tried to make the game start.

So let's get straight.
If the mouse just goes through a specific area,i want the image to change.
If then the mouse clicks,i also want the game to start.
 
there is the code from the main function

int main()
{
sf::RenderWindow window(sf::VideoMode(size*length+size, size*width+size), "SFML works!");
 Texture t4,t5;
    t4.loadFromFile("images/men.jpg");
    t5.loadFromFile("images/men2.jpg");
        Sprite nebunie(t4);
        Sprite nebunie2(t5);
        while (window.isOpen())
    {window.draw(nebunie);
    window.display();
    Event Event;
    while (window.pollEvent(Event))
    {sf::Vector2i position = sf::Mouse::getPosition();
    cout<<position.x<<" "<<position.y<<"\n";
            if (position.x>583&&position.x<820&&position.y>293&&position.y<319)
            {
                window.draw(nebunie2);window.display();
                if (Event::MouseButtonPressed)
                if (Event.mouseButton.button==Mouse::Left) game();
                }
}
}

This is my first sfml project,i m sorry if i haven't explained quite well.

Pages: [1]