DgsSetParent: Difference between revisions
Jump to navigation
Jump to search
m (DGS (OOP Syntax)/(Template Organization) Mission) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This function is used for setting a DGS element as the parent of another DGS element. | This function is used for setting a DGS element as the parent of another DGS element. | ||
{{Note| | {{Note|DGS elements are always destroyed when the resource that created them is stopped.}} | ||
{{Note|dgsSetParent only works with DGS elements.}} | {{Note|dgsSetParent only works with DGS elements.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool dgsSetParent( element theElement, element parent ) | bool dgsSetParent( element theElement, element parent ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP||DGSElement:setParent||parent|dgsGetParent||}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 19: | Line 20: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
DGS = exports.dgs | DGS = exports.dgs | ||
parent = DGS: | parent = DGS:dgsCreateWindow( 500, 500, 300, 300, "test window", false ) -- create a window | ||
label = DGS: | label = DGS:dgsCreateLabel( 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 | DGS:dgsSetParent(label, parent) -- set the window as the parent of the label | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</ | ==See Also== | ||
===<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}} |
Latest revision as of 18:39, 16 April 2021
This function is used for setting a DGS element as the parent of another DGS element.
Syntax
bool dgsSetParent( element theElement, element parent )
DGS OOP Syntax Help! I don't understand this!
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:dgsCreateWindow( 500, 500, 300, 300, "test window", false ) -- create a window label = DGS:dgsCreateLabel( 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
General Functions
- dgsGetPosition
- dgsSetPosition
- dgsSetParent
- dgsGetParent
- dgsGetChild
- dgsGetChildren
- dgsGetSize
- dgsSetSize
- dgsGetType
- dgsSetLayer
- dgsGetLayer
- dgsSetCurrentLayerIndex
- dgsGetCurrentLayerIndex
- dgsGetLayerElements
- dgsGetProperty
- dgsSetProperty
- dgsSetPropertyInherit
- dgsGetProperties
- dgsSetProperties
- dgsGetVisible
- dgsSetVisible
- dgsGetEnabled
- dgsSetEnabled
- dgsGetPositionAlignment
- dgsSetPositionAlignment
- dgsGetAlpha
- dgsSetAlpha
- dgsGetFont
- dgsSetFont
- dgsGetText
- dgsSetText
- dgsGetPostGUI
- dgsSetPostGUI
- dgsGetInputEnabled
- dgsSetInputEnabled
- dgsGetInputMode
- dgsSetInputMode
- dgsAttachToAutoDestroy
- dgsDetachFromAutoDestroy
- dgsFocus
- dgsBlur
- dgsCreateFont
- dgsBringToFront
- dgsMoveToBack
- dgsGetScreenSize
- dgsGetCursorPosition
- dgsGetMouseEnterGUI
- dgsGetMouseLeaveGUI
- dgsIsMouseWithinGUI
- dgsSetSystemFont
- dgsGetSystemFont
- dgsGetElementsInLayer
- dgsGetElementsFromResource
- dgsGetFocusedGUI
- dgsImportFunction
- dgsImportOOPClass
- dgsG2DLoadHooker
- dgsSetRenderSetting
- dgsGetRenderSetting
- dgsSimulateClick
- dgsGetRootElement
- dgsAddMoveHandler
- dgsRemoveMoveHandler
- dgsIsMoveHandled
- dgsAddSizeHandler
- dgsRemoveSizeHandler
- dgsIsSizeHandled
- dgsAttachElements
- dgsDetachElements
- dgsElementIsAttached
- dgsAddPropertyListener
- dgsRemovePropertyListener
- dgsGetListenedProperties
- dgsSetMultiClickInterval
- dgsGetMultiClickInterval
- dgsSetMouseStayDelay
- dgsGetMouseStayDelay
- dgsCenterElement
- dgsSetElementKeeperEnabled
- dgsGetElementKeeperEnabled
- dgsSetClickingSound
- dgsGetClickingSound
- dgsSetClickingSoundVolume
- dgsGetClickingSoundVolume
General Events
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange