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

Pages: [1]
1
Graphics / Mouse position relative to games window in SFML 2?
« on: August 30, 2011, 01:15:00 pm »
Hi

I've been following a tutorial for SFML http://redkiing.wordpress.com/category/games/sfml/ and have a problem. Although I got the game running with minimal changes for 2.0, I can't find how to get the mouse position relative to the games window rather the current desktop position.

These are the parts where i get the mouse click position. This part is changed from the tutorial due to Input getting scrapped in 2.0.

main.cpp
Code: [Select]


else if (Event.Type == Event.MouseButtonReleased && Event.MouseButton.Button == sf::Mouse::Left)
ui.placeInColumn(sf::Mouse());


uInterface.cpp
Code: [Select]


sf::Vector2f MousePosition(GetMousePosition.GetPosition(sf::RenderWindow &Game));

    column = float(MousePosition.x)/board.getWindowWidth()*BOARD_X_SIZE+1;



Hoping someone can give me a clue as to how to solve this!

Pages: [1]