DgsCenterElement: Difference between revisions
Jump to navigation
Jump to search
(→Syntax) |
|||
Line 17: | Line 17: | ||
DGS = exports.dgs | DGS = exports.dgs | ||
window1 = DGS:dgsCreateWindow( | window1 = DGS:dgsCreateWindow(100,50,200,200,"Center",false) --Create window1 | ||
window2 = DGS:dgsCreateWindow( | window2 = DGS:dgsCreateWindow(100,50,200,200,"RemainX",false) --Create window2 | ||
window3 = DGS:dgsCreateWindow(100,50,200,200,"RemainY",false) --Create window3 | |||
DGS:dgsCenterElement(window1) -- center window1 | |||
DGS:dgsCenterElement(window2, true, false) -- center window2 with remaining X | |||
DGS:dgsCenterElement(window3, false, true)-- center window2 with remaining Y | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 18:23, 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(100,50,200,200,"Center",false) --Create window1 window2 = DGS:dgsCreateWindow(100,50,200,200,"RemainX",false) --Create window2 window3 = DGS:dgsCreateWindow(100,50,200,200,"RemainY",false) --Create window3 DGS:dgsCenterElement(window1) -- center window1 DGS:dgsCenterElement(window2, true, false) -- center window2 with remaining X DGS:dgsCenterElement(window3, false, true)-- center window2 with remaining Y