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

Author Topic: Point Finder  (Read 1745 times)

0 Members and 1 Guest are viewing this topic.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Point Finder
« on: February 03, 2011, 06:13:01 am »
I've been thinking about this for about 3 days now, but I can't seem to figure out how I'm going to accomplish this task.

What I want to do is create a function that will be able to find a specific point on an sf::Shape and jump straight to it.
In other words, I can type in any coordinate that is on the map and it will find it and take me to it.

Any ideas would be great. :)
-Wander

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Point Finder
« Reply #1 on: February 03, 2011, 07:42:58 am »
http://www.sfml-dev.org/documentation/1.6/classsf_1_1Drawable.htm#809f25ae0b3a2015ec8a44fe9f5a0008

Do you mean this one? Check out the SFML source to see how it works.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Point Finder
« Reply #2 on: February 03, 2011, 08:31:52 am »
Well, that would work except that to keep accuracy (I have points plotted on the rectangle like a map) id have to move the view, not the rectangle.
-Wander

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Point Finder
« Reply #3 on: February 03, 2011, 09:05:10 am »
Erhm? No? It gives the local position of the point you gave to the method. So if you move the rectangle to the right, the same point given to this method won't have the same x value when returned.

Ah well I probably misinterpreted something.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio