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

Author Topic: SetRadius and origin problems in 2.0  (Read 1190 times)

0 Members and 1 Guest are viewing this topic.

galleon

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
SetRadius and origin problems in 2.0
« on: July 25, 2012, 04:28:29 pm »

I understand that, in 2.0, circles have their origins in the upper left but i'm having a lot of trouble in setting it back.

I thought i could just create a circle in the top left, set it's radius to R and then use setOrigin(R,R) and continue as normal, but i'm still having problems.

the setOrigin function does not seem to change the origin of the circle and instead just moves the circle so it is centred on 0,0.  If i try to resize with setRadius from here, it does not expand from the centre but from the top left and if i use getOrigin it says the origin is at R,R (which is where i set it to but no longer the center of the circle because it moved.

this may just be a simple problem stemming from my confusion regarding local coordinates but i cannot make any sense of it.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SetRadius and origin problems in 2.0
« Reply #1 on: July 25, 2012, 11:08:46 pm »
The origin won't change how the circle is expanded when you change the radius, these are two different things.
Laurent Gomila - SFML developer

galleon

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: SetRadius and origin problems in 2.0
« Reply #2 on: July 26, 2012, 02:39:58 am »

The origin won't change how the circle is expanded when you change the radius, these are two different things.

the documentation says that the origin of an object defines the center point for all transformations, does this not include setRadius?

so if i want to resize circles to a new radius without changing their position (that is, the position of their centers) are my only options either setScale() or having to readjust the positions after each setRadius() to fix the unwanted movement?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SetRadius and origin problems in 2.0
« Reply #3 on: July 26, 2012, 06:11:16 pm »
Yes, exactly.
Laurent Gomila - SFML developer

 

anything