DgsSetParent: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Thisdp moved page Dgs/DgsSetParent to DgsSetParent)
Line 17: Line 17:


==Example==  
==Example==  
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
DGS = exports.dgs
DGS = exports.dgs

Revision as of 02:10, 2 July 2017

This function is used for setting a DGS element as the parent of another DGS element.

[[{{{image}}}|link=|]] Note: This function does not change when an element will be destroyed - DGS elements are always destroyed when the resource that created them is stopped.
[[{{{image}}}|link=|]] Note: dgsSetParent only works with DGS elements.

Syntax

bool dgsSetParent( element theElement, element parent )  

Required Arguments

  • theElement: The dgs element that you wish to set the parent of.
  • parent: The dgs element you wish to be the parent of theElement.

Returns

Returns true if both elements are valid, false otherwise.

Example

DGS = exports.dgs
parent = DGS:dgsDxCreateWindow( 500, 500, 300, 300, "test window", false ) -- create a window
label = DGS:dgsDxCreateLabel( 0, 0, 300, 20, "test label", false ) -- create a label that its parent is the screen
DGS:dgsSetParent(label, parent) -- set the window as the parent of the label

</section>

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