if (do_name() != 'Home') : ?>
endif ?>
Posted by Mark M on Apr 15, 2008
SK,
Circle in nodebox are defined from their top-left corner so you need to go through an extra step of moving them up and to the left by the amount of the radius to have them centered where you want.
Here's a short example:
stroke(.2) nofill() #set up some constants you change to fit your needs center_x, center_y = (200, 200) gap_between_circles = 14 for diameter in range(1,20): diameter *= gap_between_circles radius = diameter/2.0 oval(center_x-radius, center_y-radius, diameter, diameter)
Posted by andrea on Apr 16, 2008
-a-
if you define:
def centeredOval(x, y, radius, other = None): if other == None: other = radius return oval(x-radius*0.5, y-other*0.5, radius, other)you can use
# centered in 10, 10 with radius 20 # other is None, so it's a circle centeredOval(10, 10, 20)Best
-a-
Posted by Spooky Kid on Apr 24, 2008
include("util/comment.php"); ?>
Thanks for your help!
concentric circles
Posted by spooky kid on Apr 15, 2008Hi, I'm new in nodebox, and I'm trying to draw concentric circles but I don't know how to center objects in the screen (align center). Can anybody help me?
Thanks!