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

Pages: [1]
1
General / Access Violation at Program Close
« on: April 19, 2009, 01:28:01 pm »
I have the same problem, the same exe crash on XP but donĀ“t in Vista...

SFML 1.4 dynamic and precompiled from the official release.

EDIT: I see its in the tasklist.

2
Graphics / Moving the View with the mouse (my solution)
« on: April 17, 2009, 04:21:50 pm »
After searching the best solution to move (scroll) the View using the mouse (pressing left button) I couldn't find anything that help me, so after spending some time trying, I have some usable solution.
Here it is if someone have the same problem!

Variables involved:
sf::Vector2f mouse(0,0); // global variable holding last position of the mouse
sf::View view; //the View asociated to the window

In the Switch handling the events:
Code: [Select]

while (Window.GetEvent(Event))
        {
            switch(Event.Type) {
                 .................

             case sf::Event::MouseMoved:
           if (!Window.GetInput().IsMouseButtonDown(sf::Mouse::Left)) {
mouse.x=Event.MouseMove.X;
mouse.y=Event.MouseMove.Y;
} else {
view.Move(mouse.x-Window.GetInput().GetMouseX(), mouse.y-Window.GetInput().GetMouseY());
mouse.x=Window.GetInput().GetMouseX();
mouse.y=Window.GetInput().GetMouseY();
}
break;
                       ...................
           }
}



Sure It may be some best aproach to do this, but it works for me!.

P.D.: I'm new so, Hello! ( and sorry for my level of english, I'm triying to improve it hehe)

EDIT: Sorry for posting at the wrong board.

Pages: [1]