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

Author Topic: Sprites rendered approximately  (Read 6713 times)

0 Members and 1 Guest are viewing this topic.

Clairvoire

  • Newbie
  • *
  • Posts: 29
    • AOL Instant Messenger - Clairvoire
    • View Profile
    • http://clairvoire.deviantart.com
Sprites rendered approximately
« Reply #15 on: November 07, 2009, 12:20:06 am »
It took a little getting used to, but I actually like the bottom/right parts of Rect.  Makes resizing subrects fast and painless (in the sense, that you can resize it to make it go straight up, or left, without extra math involved), as well as getting the right_x and bottom_y values.

The only thing that x/y/width/height really helps with seems to be initialization, in my opinion.  Too bad there's no way to just overload that in..

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Sprites rendered approximately
« Reply #16 on: November 07, 2009, 01:10:45 am »
Quote from: "Clairvoire"
The only thing that x/y/width/height really helps with seems to be initialization, in my opinion.  Too bad there's no way to just overload that in..

True also on my side. I'm not using the width and height often. Else I can directly specify the right and bottom values. In my opinion there'll always be more math needed when working with widths and heights -- nothing big, of course, but that could be mostly avoided up to now.

Btw, you can easily specify your own initialization function for that:
Code: [Select]
template <class T>
sf::Rect<T> CreateRectWithSize( T Left, T Top, T Width, T Height ) {
  return sf::Rect<T>( Left, Top, Left + Width, Top + Height );
}

 

anything