DgsGetPositionAlignment: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(DGS (OOP Syntax)/(Template Organization) Mission)
Line 1: Line 1:
{{Client function}}
__NOTOC__{{Client function}}


This function to get the alignment of position from a specific DGS element
This function to get the alignment of position from a specific DGS element
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string, string dgsGetPositionAlignment( element dgsElement )
string, string dgsGetPositionAlignment( element dgsElement )
</syntaxhighlight>  
</syntaxhighlight>
{{DGS/OOP|The '''Variable''' has the following using:
* <code>positionAlignment[1]</code> for '''horizontal''' alignment
* <code>positionAlignment[2]</code> for '''vertical''' alignment
|DGSElement:getPositionAlignment||positionAlignment|dgsSetPositionAlignment}}


===Required Arguments===  
===Required Arguments===  
Line 33: Line 37:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
=See Also=
{{DGSFUNCTIONS}}
 
==<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}}

Revision as of 17:56, 19 April 2021

This function to get the alignment of position from a specific DGS element

Syntax

string, string dgsGetPositionAlignment( element dgsElement )

DGS OOP Syntax Help! I don't understand this!

Required Arguments

  • dgsElement: The DGS element to change the alignment.

Returns

Return two strings, indicates horizontal and vertical alignment.

  • horizontalAlignment:
    • left
    • center
    • right
  • verticalAlignment:
    • top
    • center
    • bottom

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)

local hAlign,vAlign = DGS:dgsGetPositionAlignment(button)
outputChatBox(hAlign.."-"..vAlibn)

See Also

General Functions

General Events