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

Author Topic: Mouse Move Method  (Read 2277 times)

0 Members and 1 Guest are viewing this topic.

drakelord

  • Newbie
  • *
  • Posts: 22
    • View Profile
Mouse Move Method
« on: October 26, 2011, 04:48:32 pm »
Hey guys, I have a quick question about a particular method.

I'm designing a little utility, not an actual game per say.  But it uses a 360 degree viewing system.  What I'm trying to think about how to do is use the mouse input to rotate the view across the space.  I know SFML sends mouse movement events in a position relative to itself.  

I think the best way to do that would be to get the change in movement from the previous frame, calculate the difference based on mouse sensitivity and current resolution, and apply that, then reset the "cursor position", but I don't know if SFML supports that natively.

 <-- an example of what I was talking about in terms of view.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Mouse Move Method
« Reply #1 on: October 26, 2011, 05:37:54 pm »
With SFML 2, you can use sf::View::Rotate() to rotate the view and sf::Mouse::SetPosition() to place the cursor on the screen.

If you need more, you have to ask a question :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

drakelord

  • Newbie
  • *
  • Posts: 22
    • View Profile
Mouse Move Method
« Reply #2 on: October 26, 2011, 06:57:42 pm »
Awesome, thanks for the reply!