Jump to content

[Help] making a movable dxwindow


kikos500

Recommended Posts

so i want to make a movable dx window like gui one so i have tried this but it doesn't work

  
function moving(cx,cy) 
    for _,moving in pairs(elements_Table.windows) do 
        if isCursorHover(moving.x,moving.y,moving.w,20) then 
        outputChatBox("RIGHT PART") 
            if getKeyState("mouse1") then 
        --      if moving.movable then 
                    moving.x = moving.px - cx 
                    moving.y = moving.py - cy 
                    outputChatBox("moving") 
            --  end 
            end 
        end 
    end 
end 
addEventHandler("onClientCursorMove",root,moving) 
  

moving.px -- the default x for the window

moving.py -- the default y for the window

moving.x -- the window x

moving.y -- the window y

Link to comment

it says some points but still the dx window doesn't move at all

  
function testMoving(cx,cy) 
    for _,moving in pairs(elements_Table.windows) do 
        if isCursorHover(moving.x,moving.y,moving.w,20) then 
        outputChatBox("RIGHT PART") 
            if getKeyState("mouse1") then 
        --      if moving.movable then 
                    moving.x = moving.px - cx 
                    moving.y = moving.py - cy 
                    outputChatBox(""..moving.x.." "..moving.y) 
            --  end 
            end 
        end 
    end 
end 
addEventHandler("onClientCursorMove",root,testMoving) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...