Console Sidebar width

Is there a notification for when the viewer.mode changes. More importantly, how can I get the WIDTH of the console sidebar? Or similarly, the WIDTH of the canvas minus the sidebar (in its current state)?

1 Like

Glad you asked! Try


-- SafeArea

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")

-- This function gets called once every frame
function draw()
    -- hey there!
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness

    -- Do your drawing here
    ellipse(layout.safeArea.left, HEIGHT/2, 300)

That does the trick. Thanks.
(Nice example, but the way.)

1 Like