• Thanks for the replies! After reading them a few times and experimenting I think I'm understanding it now.

    To create and position a rect using paths, I'm creating it with ui.Path.rect() and just giving 0,0 for the position with the desired size. Then I'm setting the position property to locate the center where I want it.

    Seems to be working, thanks for the help!

  • a (very) small improvement:

    tot_time = 2 # total time in seconds for i in range(0, 360): mc.deg = i mc.set_needs_display() time.sleep(tot_time/360)
  • @JonB , I know I am frustrating at times 😱😬 believe me, I frustrate myself more....

    I really try not touch objc unless I copy some simple code for brightness etc... Seems pointless to me, if I struggle with Python, I can just imagine the mess I would get myself in with objc. It also suits me as its a hobby. I would have a completely different view if I was still working.

    Anyway, I think I will look at a list of shapes for the moment. I might be fine. I think I will have to rethink my approach though. It's getting to big, I think. It's becoming the anti helper.

    As I say, it's ok. I will just keep plodding away. I am sure one day, it all will become clearer than mud 😬🎉

    My approach maybe is stupid. I was just building it up to try to see where the challenges where going to lay as I tried to do more complex things.
    If you are interested at all, here is my gist

  • @Phuket2 I don't have much to add other than what JonB has said... just classing it.
    But I really understand what you mean - to have easier ways to accomplish something so simple. Such as:

    a = ui.Path.oval(fill_color=red, frame=(0,0,100,100), stroke=1, stroke_color=green, opacity=0.5)

    I think that what you're after are similar things that we find in SVG graphic design. For me the ui.Path doesn't seem so different than this... it's just that you have to code in a lot of stuff to get it going. But it seems that there's just certain things in the UI that require this step by step. I also kind of want to try classing just to see.

  • @dgelessus , ok I think I see. Actually draw also does not exist in a custom class unless you have a draw method. I was just doing some print dir(obj) to understand your post.
    If you print dir(custom_class) without a draw method defined it does not show up. So I guess it's just added at runtime as required. Not sure that's normal or not. I would have thought the method would be there, but not the ImageContext etc...not sure if it's normal or not . But seems like maybe @omz took a logic short cut 😱😈😈😈

    Sure I will regret this post also, I am probably way off course. I will learn to keep my big mouth shut one day.

  • thx solved

Internal error.

Oops! Looks like something went wrong!