DxGUI/dxMove

From Multi Theft Auto: Wiki
Revision as of 11:18, 4 January 2014 by Darth Poezd (talk | contribs) (Created page with "You can use this function to move dxGUI element. ==Syntax== <syntaxhighlight lang="lua"> dxMove (element dxElement, float xMove, float yMove) </syntaxhighlight> ===Required Arguments=== *'''dxElement:'...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You can use this function to move dxGUI element.

Syntax

dxMove (element dxElement, float xMove, float yMove)

Required Arguments

  • dxElement: A dxGUI element.
  • xMove: Position X, where dxGUI element move.
  • yMove: Position Y, where dxGUI element move.

Returns

  • false if dxElement, xMove, yMove are not set.

Example

This example moves dxGUI window to (0;0).

Click to collapse [-]
Client
local x, y = guiGetScreenSize() --Getting screen size
addEventHandler("onClientResourceStart", resourceRoot, 
    function()
        --Create dxGUI window with name "wind":
        wind = dxCreateWindow(x/2, y/2, 50, 50, "Window", tocolor(255,255,255,255),"default-bold","Lighter Black")
    end)    
--Move dxGUI to (0;0) when player joining.
addEventHandler("onClientPlayerJoin", resourceRoot, function() dxMove(wind, 0, 0) end)

See Also

Back to dxGUI page