This discussion is archived
2 Replies Latest reply: Mar 21, 2013 9:09 AM by morgalr RSS

Centering Shapes

998353 Newbie
Currently Being Moderated
Not even sure this is where you post help questions, but if you were to draw a shape, the x,y coordinate determines the top-left corner of the shape. Is there any way to make the x,y the middle? I've tried more "amateur" forums, but since they're so abandoned, I have no choice but to turn to you with this simple question. Thank you!
  • 1. Re: Centering Shapes
    PhHein Guru Moderator
    Currently Being Moderated
    Short: no, you cannot make x and y centered.
    BUT: you can recalculate x and y to center the shape within your container or on screen.
  • 2. Re: Centering Shapes
    morgalr Explorer
    Currently Being Moderated
    As mentioned by the mod... nope, but it can be calculated.

    What I usually do is make my object take care of painting itself, but parameters of convenience for control--graphics context, location, color, scale, and etc... that way I can send the centered coordinates to the object and it can calculate palcement according to scale.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points