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

Author Topic: View.Move() - How does it work? (eg. it moves in "unit  (Read 2943 times)

0 Members and 1 Guest are viewing this topic.

sofakng

  • Newbie
  • *
  • Posts: 18
    • View Profile
View.Move() - How does it work? (eg. it moves in "unit
« on: January 30, 2009, 05:57:18 pm »
I'm a little confused on View.Move() and how it works.  The help file says it "moves the view" and the online tutorial says that it moves the view by X "units".  What does that mean?

Does it move the view by X number of pixels?  (eg. scroll the view)

I've tried m_renderWindow.DefaultView.Move(10, 0) and thought it would scroll my view to the right but instead it seems to scroll downward.

Also, I'm just curious but why is there a HalfSize and not just a Size variable? :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
View.Move() - How does it work? (eg. it moves in "unit
« Reply #1 on: January 30, 2009, 11:40:25 pm »
Quote
I'm a little confused on View.Move() and how it works. The help file says it "moves the view" and the online tutorial says that it moves the view by X "units". What does that mean?

It means the view moves from X units in scene coordinates (i.e. the global ones). And yes, it means the view is scrolling. You can see the view as a 2D camera which is looking at your scene, and is mapped to the window.

Quote
I've tried m_renderWindow.DefaultView.Move(10, 0) and thought it would scroll my view to the right but instead it seems to scroll downward.

That's weird. Can you show more code?

Quote
Also, I'm just curious but why is there a HalfSize and not just a Size variable?

That's usually more useful when the other parameter is the center. If the first parameter was one of the corners, then the full size would make more sense.
Laurent Gomila - SFML developer

sofakng

  • Newbie
  • *
  • Posts: 18
    • View Profile
View.Move() - How does it work? (eg. it moves in "unit
« Reply #2 on: February 07, 2009, 04:24:30 am »
Thanks for the reply!  I was able to figure out what I was doing wrong...

 

anything