DgsSetPositionAlignment: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(DGS (OOP Syntax)/(Template Organization) Mission)
m (little correction)
Line 7: Line 7:
bool dgsSetPositionAlignment( element dgsElement [, string horizontalAlignment, string verticalAlignment ] )
bool dgsSetPositionAlignment( element dgsElement [, string horizontalAlignment, string verticalAlignment ] )
</syntaxhighlight>
</syntaxhighlight>
{{DGS/OOP|The '''Variable''' has the following using:
{{DGS/OOP|The '''Variable''' It's a table and has the following using:
* <code>positionAlignment[1]</code> for '''horizontal''' alignment
* <code>positionAlignment[1]</code> for '''horizontal''' alignment
* <code>positionAlignment[2]</code> for '''vertical''' alignment
* <code>positionAlignment[2]</code> for '''vertical''' alignment

Revision as of 17:59, 19 April 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!

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

General Events