I’m trying to draw a box in the center of the screen using the below. The box is drawn centered about the origin (lower left corner of the screen). It doesn’t seem to respect the x and y values I’m giving it. I’m sure I’m missing something obvious :). Can anyone point me in the right direction?
import scene as sc
import ui
class MyScene (sc.Scene):
def setup(s):
s.background_color = 'blue'
s.bdr = sc.ShapeNode()
s.bdr.fill_color = (0,0,0,0)
s.bdr.stroke_color = 'yellow'
cx = s.size.width
cy = s.size.height
s.bdr.path = ui.Path.rect(cx / 2, cy / 2, 100, 100)
s.bdr.line_width = 3
s.add_child(s.bdr)
sc.run(MyScene())