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

Author Topic: SetLeft() & SetTop()  (Read 7227 times)

0 Members and 1 Guest are viewing this topic.

lubos

  • Newbie
  • *
  • Posts: 17
    • ICQ Messenger - 385328377
    • MSN Messenger - qwarmail@yahoo.co.uk
    • View Profile
SetLeft() & SetTop()
« on: September 02, 2007, 03:04:30 pm »
In Drawable class, why its called SetLeft() & SetTop() instead of SetX() & SetY()? I think more users would be comfortable with second method. what do you think?

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
SetLeft() & SetTop()
« Reply #1 on: September 02, 2007, 03:33:32 pm »
I think Laurent use thoses names because of Left,Right,Top,Bottom of the sfRect class. The Sprite use this class, and what you do is just setting the top and left coords.
But I thought the same thing first time I saw them. Maybe both functions doing the same can be an idea ?
Mindiell
----

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SetLeft() & SetTop()
« Reply #2 on: September 02, 2007, 05:01:29 pm »
I think Left and Top are just clearer than X and Y. You don't wonder if it refers to the center of the sprite, the center of rotation, the left-bottom corner, etc.
Laurent Gomila - SFML developer