DgsAttachToAutoDestroy: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (little correction) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function allows you to | This function allows you to make a specific element destroy with a dgs element. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool dgsAttachToAutoDestroy(element, dgsElement) | bool dgsAttachToAutoDestroy( element sourceElement, element dgsElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP| | |||
Method = '''dgsRootInstance''':attachToAutoDestroy| | |||
Counterpart = dgsDetachFromAutoDestroy | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''sourceElement:''' An element that you want to attach. | ||
*'''dgsElement:''' | *'''dgsElement:''' A dgs element you want to attach to | ||
===Returns=== | ===Returns=== | ||
Returns | Returns ''true'' if successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
Line 27: | Line 31: | ||
end,2000,1) | end,2000,1) | ||
</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 21:37, 3 May 2021
This function allows you to make a specific element destroy with a dgs element.
Syntax
bool dgsAttachToAutoDestroy( element sourceElement, element dgsElement )
DGS OOP Syntax Help! I don't understand this!
- Method: dgsRootInstance:attachToAutoDestroy(...)
- Counterpart: dgsDetachFromAutoDestroy
Required Arguments
- sourceElement: An element that you want to attach.
- dgsElement: A dgs element you want to attach to
Returns
Returns true if successful, false otherwise.
Example
This example create a vehicle attached to window, which will be destroyed after 2 seconds with window
DGS = exports.dgs local window = dgsCreateWindow(200,200,200,200,"test",false) local vehicle = createVehicle(411,0,0,3) dgsAttachToAutoDestroy(vehicle,window) setTimer(function() destroyElement(window) end,2000,1)
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