DgsCenterElement: Difference between revisions
Jump to navigation
Jump to search
(→Syntax) |
|||
Line 12: | Line 12: | ||
*'''remainX:''' Remain X position while centering the window | *'''remainX:''' Remain X position while centering the window | ||
*'''remainY:''' Remain Y position while centering the window | *'''remainY:''' Remain Y position while centering the window | ||
==Example== | |||
<syntaxhighlight lang="lua"> | |||
DGS = exports.dgs | |||
window1 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 1",false) --Create window1 | |||
window2 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 2",false) --Create window2 | |||
local layer = DGS:dgsGetLayer (window1) | |||
outputChatBox(layer) -- The default layer is center | |||
</syntaxhighlight> |
Revision as of 18:19, 21 April 2020
Syntax
dgsCenterElement ( element,[ bool remainX, bool remainY ] )
Required Arguments
- element: The DGS element to center
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- remainX: Remain X position while centering the window
- remainY: Remain Y position while centering the window
Example
DGS = exports.dgs window1 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 1",false) --Create window1 window2 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 2",false) --Create window2 local layer = DGS:dgsGetLayer (window1) outputChatBox(layer) -- The default layer is center