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

Author Topic: changing cursor position and relative motion  (Read 14290 times)

0 Members and 1 Guest are viewing this topic.

sirGustav

  • Newbie
  • *
  • Posts: 22
    • View Profile
changing cursor position and relative motion
« on: January 05, 2008, 03:53:08 pm »
Looking at the documentation I cant's seem to find anything related to relative mouseinput or changing the position of the cursor.

This is (especially) useful for first person styled movement like:
Code: [Select]
sf::Event Event;
App.GetMouseState( Event );
// use Event.Mouse for moving camera
App.MoveCursorTo(width/2, height/2);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
changing cursor position and relative motion
« Reply #1 on: January 05, 2008, 04:32:03 pm »
Mouse coordinates :
Code: [Select]
float X = App.GetInput().GetMouseX();
float Y = App.GetInput().GetMouseY();


Cursor position (in next release) :
Code: [Select]
App.SetCursorPosition(X, Y);
Laurent Gomila - SFML developer

sirGustav

  • Newbie
  • *
  • Posts: 22
    • View Profile
changing cursor position and relative motion
« Reply #2 on: January 05, 2008, 05:34:06 pm »
thanks, propbably should have looked better at the roadmap :)
*goes away to get the rc*

edit: after a few minor tweaks(to my code) the rc works like a charm, now I'm having trouble of finding anything wrong with this library - I really like the cleanness of the design. Thanks for a wonderful library and a great support :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
changing cursor position and relative motion
« Reply #3 on: January 06, 2008, 05:08:14 am »
Quote
now I'm having trouble of finding anything wrong with this library

Damn, I should really add new bugs to the next release :D

Quote
I really like the cleanness of the design. Thanks for a wonderful library and a great support

Thank you ;)
Laurent Gomila - SFML developer

Hugo

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
changing cursor position and relative motion
« Reply #4 on: July 11, 2010, 07:17:52 am »
Quote:
now I'm having trouble of finding anything wrong with this library  

Quote:
I really like the cleanness of the design. Thanks for a wonderful library and a great support

*in British accent*
Too right mate