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

Author Topic: Drawable Center not updating with movement  (Read 2898 times)

0 Members and 1 Guest are viewing this topic.

MarekkPie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Drawable Center not updating with movement
« on: January 22, 2012, 07:49:09 am »
I don't know if this is intentional or not (but I doubt it is), but when you update the position of a Drawable, the rest of the position relative variables (specifically Center) do not update accordingly. It seems in the C++ documentation that there is a Move method that may do this part for you, but at least in SFML.NET 1.6 it doesn't seem to exist.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Drawable Center not updating with movement
« Reply #1 on: January 22, 2012, 10:59:17 am »
This is intentional, position and center are independent attributes.

The position is the translation relative to the global coordinate system (left-upper window corner in default view), the center the translation relative to the local coordinate system (the sprite's left-upper corner).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

MarekkPie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Drawable Center not updating with movement
« Reply #2 on: January 22, 2012, 05:11:13 pm »
Interesting, and a bit confusing for a reader. I get what you mean, but "center" doesn't really equate to "upper-left" to me. A center isn't a arbitrary location, it's the center of the object. I would have thought "origin" would be more appropriate, since you are probably using that point the manipulate the image in its local space or rotate the image around that point. Maybe it's just a translation thing.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Drawable Center not updating with movement
« Reply #3 on: January 22, 2012, 05:19:54 pm »
Quote
I would have thought "origin" would be more appropriate

Guess what... it's named "origin" in SFML 2 ;)
Laurent Gomila - SFML developer

MarekkPie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Drawable Center not updating with movement
« Reply #4 on: January 22, 2012, 05:21:14 pm »
Sweet.