DgsCenterElement: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(DGS (OOP Syntax)/(Template Organization) Mission) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Client function}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
dgsCenterElement ( element, | bool dgsCenterElement ( element dgsElement [, bool remainX, bool remainY ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP| | |||
Method = DGSElement:center | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 10: | Line 15: | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
*'''remainX:''' | *'''remainX:''' A bool indicates whether to remain X position while centering the window | ||
*'''remainY:''' | *'''remainY:''' A bool indicates whether to remain Y position while centering the window | ||
==Example== | ==Example== | ||
Line 25: | Line 30: | ||
DGS:dgsCenterElement(window3, false, true)-- center window3 with remaining Y | DGS:dgsCenterElement(window3, false, true)-- center window3 with remaining Y | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=See Also= | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Functions</span>== | |||
{{DGS General Functions}} | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Events</span>== | |||
{{DGS Events/General}} |
Latest revision as of 23:18, 3 May 2021
Syntax
bool dgsCenterElement ( element dgsElement [, bool remainX, bool remainY ] )
DGS OOP Syntax Help! I don't understand this!
- Method: DGSElement:center(...)
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: A bool indicates whether to remain X position while centering the window
- remainY: A bool indicates whether to 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 window3 with remaining Y
See Also
General Functions
- dgsGetPosition
- dgsSetPosition
- dgsSetParent
- dgsGetParent
- dgsGetChild
- dgsGetChildren
- dgsGetSize
- dgsSetSize
- dgsGetType
- dgsSetLayer
- dgsGetLayer
- dgsSetCurrentLayerIndex
- dgsGetCurrentLayerIndex
- dgsGetLayerElements
- dgsGetProperty
- dgsSetProperty
- dgsSetPropertyInherit
- dgsGetProperties
- dgsSetProperties
- dgsGetVisible
- dgsSetVisible
- dgsGetEnabled
- dgsSetEnabled
- dgsGetPositionAlignment
- dgsSetPositionAlignment
- dgsGetAlpha
- dgsSetAlpha
- dgsGetFont
- dgsSetFont
- dgsGetText
- dgsSetText
- dgsGetPostGUI
- dgsSetPostGUI
- dgsGetInputEnabled
- dgsSetInputEnabled
- dgsGetInputMode
- dgsSetInputMode
- dgsAttachToAutoDestroy
- dgsDetachFromAutoDestroy
- dgsFocus
- dgsBlur
- dgsCreateFont
- dgsBringToFront
- dgsMoveToBack
- dgsGetScreenSize
- dgsGetCursorPosition
- dgsGetMouseEnterGUI
- dgsGetMouseLeaveGUI
- dgsIsMouseWithinGUI
- dgsSetSystemFont
- dgsGetSystemFont
- dgsGetElementsInLayer
- dgsGetElementsFromResource
- dgsGetFocusedGUI
- dgsImportFunction
- dgsImportOOPClass
- dgsG2DLoadHooker
- dgsSetRenderSetting
- dgsGetRenderSetting
- dgsSimulateClick
- dgsGetRootElement
- dgsAddMoveHandler
- dgsRemoveMoveHandler
- dgsIsMoveHandled
- dgsAddSizeHandler
- dgsRemoveSizeHandler
- dgsIsSizeHandled
- dgsAttachElements
- dgsDetachElements
- dgsElementIsAttached
- dgsAddPropertyListener
- dgsRemovePropertyListener
- dgsGetListenedProperties
- dgsSetMultiClickInterval
- dgsGetMultiClickInterval
- dgsSetMouseStayDelay
- dgsGetMouseStayDelay
- dgsCenterElement
- dgsSetElementKeeperEnabled
- dgsGetElementKeeperEnabled
- dgsSetClickingSound
- dgsGetClickingSound
- dgsSetClickingSoundVolume
- dgsGetClickingSoundVolume
General Events
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange