DgsCenterElement: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool dgsCenterElement ( element dgsElement, [ bool remainX, bool remainY ] )
bool dgsCenterElement ( element dgsElement [, bool remainX, bool remainY ] )
</syntaxhighlight>  
</syntaxhighlight>  



Revision as of 09:23, 17 January 2021

Syntax

bool dgsCenterElement ( element dgsElement [, bool remainX, bool remainY ] )

Required Arguments

Example
  • 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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips