How to Mini Window Docked?

Posted by Errigour on Sat 13 Jun 2026 10:43 PM — 5 posts, 1,302 views.

USA #0
I have successfully created a miniwindow but I don't see an option to make it a docked window. Is there a way to do this?

function init()
    local width = GetInfo(281)   -- main window width
    local height = GetInfo(280)  -- main window height

    WindowCreate(
        "chatwin",
        0, 0, width, 150,   -- left, top, width, height=150px
        2,
        2,
        0x000000
    )

    -- Draw a border so you can SEE it
    WindowRectOp("chatwin", miniwin.rect_frame, 0, 0, 0, 0, 0x777777)

    -- Force a repaint
    WindowShow("chatwin", true)
end
Amended on Sun 14 Jun 2026 12:06 PM by Errigour
USA #1
Also i cant seem to get the scrolling to work with hotspots what am i doing wrong?

    WindowScrollwheelHandler("chatwin", "hs1", "wheel_move")
    WindowAddHotspot(
        "chatwin",
        "hs1",
        0, 0, width, 150,   -- FULL WINDOW
        0,
        0,
        "",
        "",
        "",
        miniwin.cursor_hand,
        0,
        0
    )
USA #2
Hey thanks for letting me waste your time ai helped me figure this all out. Uhm here is some code that is working for now.

chat_buffer = {}
chat_max_lines = 200   -- how many lines to keep
chat_line_height = 14  -- pixel height per line
chat_scroll = 0   -- 0 = bottom, positive = scroll up
function wheel_move(flags, hotspot_id)
    -- wheel down (towards you)
    if bit.band(flags, 0x100) ~= 0 then
        chat_scroll = chat_scroll - 1
    else
        -- wheel up (away from you)
        chat_scroll = chat_scroll + 1
    end
    if chat_scroll < 0 then chat_scroll = 0 end
    if chat_scroll > #chat_buffer - 1 then
        chat_scroll = #chat_buffer - 1
    end
    chat_redraw()
    return 0
end
function init()
    local width = GetInfo(281)   -- main window width
    local height = GetInfo(280)  -- main window height

    WindowCreate(
        "chatwin",
        0, 0, width, 150,   -- left, top, width, height=150px
        2,
        0,
        0x000000
    )
    -- Draw a border so you can SEE it
    WindowRectOp("chatwin", miniwin.rect_frame, 0, 0, 0, 0, 0x777777)

    -- Force a repaint
    WindowShow("chatwin", true)
    WindowAddHotspot(
        "chatwin",
        "hs1",
        0, 0, width, 150,   -- FULL WINDOW
        "", -- mouse over script to call
        "", -- cancel mouse over
        "", -- mouse down
        "", -- cancel mouse down
        "", -- mouse up
        "Hovering Over", -- Tooltip text
        0,
        0
    )
    WindowScrollwheelHandler("chatwin", "hs1", "wheel_move")
end
function chat_redraw()
    if #chat_buffer == 0 then
        WindowShow("chatwin", true)
        return
    end

    local width = GetInfo(281)
    local height = 150

    WindowResize("chatwin", width, height, 0x000000)
    WindowRectOp("chatwin", miniwin.rect_fill, 0, 0, width, height, ColourNameToRGB("black"))

    local fi = WindowFontInfo("chatwin", "chatfont", 1)

    if not fi then
        WindowFont("chatwin", "chatfont", "Consolas", 9)
    end

    local start_index = math.max(1, #chat_buffer - chat_scroll)
    local y = height - chat_line_height

    for i = start_index, 1, -1 do
        WindowText("chatwin", "chatfont", chat_buffer, 5, y, 0, 0, 0xFFFFFF)
        y = y - chat_line_height
        if y < 0 then break end
    end

    WindowShow("chatwin", true)
end
function chat_add(text)
    table.insert(chat_buffer, text)

    -- trim buffer
    if #chat_buffer > chat_max_lines then
        table.remove(chat_buffer, 1)
    end

    chat_redraw()
end
function hide_chat()
    WindowShow("chatwin", false)
end
USA #3
Alright guys here is some of my code, uhm I got it to work but I still don't know how to dock the window.

chat_buffer = {}
chat_max_lines = 200   -- how many lines to keep
chat_line_height = 14  -- pixel height per line
chat_scroll = 0   -- 0 = bottom, positive = scroll up
function wheel_move(flags, hotspot_id)
    -- wheel down (towards you)
    if bit.band(flags, 0x100) ~= 0 then
        chat_scroll = chat_scroll - 1
    else
        -- wheel up (away from you)
        chat_scroll = chat_scroll + 1
    end
    if chat_scroll < 0 then chat_scroll = 0 end
    if chat_scroll > #chat_buffer - 1 then
        chat_scroll = #chat_buffer - 1
    end
    chat_redraw()
    return 0
end
function init()
    local width = GetInfo(281)   -- main window width
    local height = GetInfo(280)  -- main window height

    WindowCreate(
        "chatwin",
        0, 0, width, 150,   -- left, top, width, height=150px
        2,
        0,
        0x000000
    )
    -- Draw a border so you can SEE it
    WindowRectOp("chatwin", miniwin.rect_frame, 0, 0, 0, 0, 0x777777)

    -- Force a repaint
    WindowShow("chatwin", true)
    WindowAddHotspot(
        "chatwin",
        "hs1",
        0, 0, width, 150,   -- FULL WINDOW
        "", -- mouse over script to call
        "", -- cancel mouse over
        "", -- mouse down
        "", -- cancel mouse down
        "", -- mouse up
        "Hovering Over", -- Tooltip text
        0,
        0
    )
    WindowScrollwheelHandler("chatwin", "hs1", "wheel_move")
end
function chat_redraw()
    if #chat_buffer == 0 then
        WindowShow("chatwin", true)
        return
    end

    local width = GetInfo(281)
    local height = 150

    WindowResize("chatwin", width, height, 0x000000)
    WindowRectOp("chatwin", miniwin.rect_fill, 0, 0, width, height, ColourNameToRGB("black"))

    local fi = WindowFontInfo("chatwin", "chatfont", 1)

    if not fi then
        WindowFont("chatwin", "chatfont", "Consolas", 9)
    end

    local start_index = math.max(1, #chat_buffer - chat_scroll)
    local y = height - chat_line_height

    for i = start_index, 1, -1 do
        WindowText("chatwin", "chatfont", chat_buffer, 5, y, 0, 0, 0xFFFFFF)
        y = y - chat_line_height
        if y < 0 then break end
    end

    WindowShow("chatwin", true)
end
function chat_add(text)
    table.insert(chat_buffer, text)

    -- trim buffer
    if #chat_buffer > chat_max_lines then
        table.remove(chat_buffer, 1)
    end

    chat_redraw()
end
function hide_chat()
    WindowShow("chatwin", false)
end
Amended on Sun 14 Jun 2026 01:34 PM by Errigour
USA #4
Actually I didn't figure out how to dock the window though but I figured out the second part.