DgsSetPositionAlignment: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client function}} This function to set the alignment of position of a specific DGS element ==Syntax== <syntaxhighlight lang="lua"> bool dgsSetElementAlignment( element dgs...") |
m (DGS OOP Syntax changing) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | __NOTOC__{{Client function}} | ||
This function to set the alignment of position of a specific DGS element | This function to set the alignment of position of a specific DGS element | ||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool dgsSetPositionAlignment( element dgsElement [, string horizontalAlignment, string verticalAlignment ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP| | |||
Note = The '''Variable''' It's a table and has the following using: | |||
* <code>positionAlignment[1]</code> for '''horizontal''' alignment | |||
* <code>positionAlignment[2]</code> for '''vertical''' alignment| | |||
Method = DGSElement:setPositionAlignment| | |||
Variable = positionAlignment| | |||
Counterpart = dgsGetPositionAlignment | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 31: | Line 39: | ||
local button = DGS:dgsCreateButton(0.0, 0.0, 0.2, 0.1, "Ok", true, window) | local button = DGS:dgsCreateButton(0.0, 0.0, 0.2, 0.1, "Ok", true, window) | ||
DGS: | DGS:dgsSetPositionAlignment(button, "right", "top") -- Now x=0,y=0 means right-top | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==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 21:15, 3 May 2021
This function to set the alignment of position of a specific DGS element
Syntax
bool dgsSetPositionAlignment( element dgsElement [, string horizontalAlignment, string verticalAlignment ] )
DGS OOP Syntax Help! I don't understand this!
- Note: The Variable It's a table and has the following using:
positionAlignment[1]
for horizontal alignmentpositionAlignment[2]
for vertical alignment
- Method: DGSElement:setPositionAlignment(...)
- Variable: .positionAlignment
- Counterpart: dgsGetPositionAlignment
Required Arguments
- dgsElement: The DGS element to change the alignment.
Optional Arguments
- horizontalAlignment: A string of horizontal alignment. Available values are as follows:
- left
- center
- right
- verticalAlignment : A string of vertical alignment. Available values are as follows:
- top
- center
- bottom
Returns
Return true if successful, false otherwise.
Example
DGS = exports.dgs local window = DGS:dgsCreateWindow(0.40, 0.33, 0.20, 0.21, "DGS Window", true) local button = DGS:dgsCreateButton(0.0, 0.0, 0.2, 0.1, "Ok", true, window) DGS:dgsSetPositionAlignment(button, "right", "top") -- Now x=0,y=0 means right-top
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