DgsSetParent: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This example | This example shows how it works: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:21, 27 June 2017
This function is used for setting a DGS element as the parent of another DGS element.
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
Click to collapse [-]
ClientThis example shows how it works:
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
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement