OSRS Plugin API
    Preparing search index...

    Interface ProportionSized

    A UI object that may be manually or automatically sized.

    interface ProportionSized {
        height: number;
        heightRatio: number;
        sizeMode: LayoutMode;
        width: number;
        widthRatio: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    height: number

    The height of this element, in UI coordinate space.

    -- Create a window that has a set height
    local window = osrs.Ui.window({title = "Example Window", sizeMode = 1, height = 200})

    -- Add window to the canvas
    osrs.Ui.canvas:addChild(window)
    heightRatio: number

    The percentage height of the screen this element should take up when sizeMode is set to LayoutMode.PROPORTIONAL. The number needs to be a decimal.

    -- Create new container with a set widthRatio and heightRatio
    local newWindow = osrs.Ui.window({title = "Example Window", sizeMode = 2, widthRatio = 0.7, heightRatio = .2})

    -- Add container to the canvas
    osrs.Ui.canvas:addChild(newWindow)
    sizeMode: LayoutMode

    How this element should size itself.

    LayoutMode::AUTOMATIC
    
    -- Create a window that has automatic size mode, this is default
    local window1 = osrs.Ui.window({title = "Automatic Size Mode"})

    -- Create a window that has manual size mode
    local window2 = osrs.Ui.window(
    {
    title = "Manual Size Mode",
    sizeMode = osrs.Ui.LayoutMode.MANUAL,
    height = 200,
    width = 200
    }
    )

    -- Add the windows to the canvas
    osrs.Ui.canvas:addChild(window1)
    osrs.Ui.canvas:addChild(window2)
    width: number

    The width of this element, in UI coordinate space.

    -- Create a window that has a set width
    local window = osrs.Ui.window({title = "Example Window", sizeMode = 1, width = 200})

    -- Add window to the canvas
    osrs.Ui.canvas:addChild(window)
    widthRatio: number

    The percentage width of the screen this element should take up when sizeMode is set to LayoutMode.PROPORTIONAL. The number needs to be a decimal.

    -- Create new container with a set widthRatio and heightRatio
    local newWindow = osrs.Ui.window({title = "Example Window", sizeMode = 2, widthRatio = 0.7, heightRatio = .2})

    -- Add container to the canvas
    osrs.Ui.canvas:addChild(newWindow)