movement cursor

IlyaHL2

Активный
Автор темы
231
49
Версия MoonLoader
.026-beta
Почему кнопка не передвигается?
Lua:
function cursor()
    cur = imgui.GetWindowPos()
    cps = imgui.GetWindowSize()
    X,Y = getCursorPos()
    x1, y1 =  X - cur.x, Y - cur.y
    if (cps.x > x1 or cps.y > y1) and (cps.x > x1 and cps.y > y1) and (x1 > 0 and y1 > 0) then
        return x1,y1
    end
end

function imgui.OnDrawFrame()
    imgui.Begin('My window', nil, imgui.WindowFlags.NoTitleBar)
        x,y = cursor()
        imgui.PushStyleVar(imgui.StyleVar.FrameRounding, 100)
            imgui.Button('ASS')
        imgui.PopStyleVar(1)
      
        if imgui.IsItemActive() then
            print(x,y)
            imgui.SetCursorPosX(x)
        end
    imgui.End()
end