SetElementCallPropagationEnabled: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server function}} Someone who knows what http://code.google.com/p/mtasa-blue/source/detail?r=6117 means needs to document this page. ==Syntax== <syntaxhighlight lang="lua"> ...") |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function enables/disables call propagation on a certain element. Look at the example for a practical application. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">bool setElementCallPropagationEnabled ( element theElement, bool enabled )</syntaxhighlight> | ||
</syntaxhighlight> | |||
===Required Arguments=== | |||
*'''theElement:''' The element whose propagation behaviour you'd like to change | |||
*'''enabled:''' Whether propagation should be enabled or not | |||
===Returns=== | ===Returns=== | ||
Returns ''true'', if the propagation behaviour has been changed successfully, ''false'' otherwise. | |||
==Example== | |||
<syntaxhighlight lang="lua"> | |||
local parentImage = guiCreateStaticImage(0, 0, 64, 64, "img1.png", false) | |||
local childImage = guiCreateStaticImage(0, 0, 16, 16, "img2.png", false, parentImage) | |||
-- Disable call propagation | |||
setElementCallPropagationEnabled(parentImage, false) | |||
-- Load another image | |||
guiStaticImageLoadImage(parentImage, "img3.png") | |||
--[[ | |||
Normally (enabled call propagation) both parentImage and childImage would contain "img3.png" now. | |||
Due to disabled call propagation only parentImage will contain "img3.png" now (the call was not propagated down the tree) | |||
]] | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 16:32, 17 April 2014
This function enables/disables call propagation on a certain element. Look at the example for a practical application.
Syntax
bool setElementCallPropagationEnabled ( element theElement, bool enabled )
Required Arguments
- theElement: The element whose propagation behaviour you'd like to change
- enabled: Whether propagation should be enabled or not
Returns
Returns true, if the propagation behaviour has been changed successfully, false otherwise.
Example
local parentImage = guiCreateStaticImage(0, 0, 64, 64, "img1.png", false) local childImage = guiCreateStaticImage(0, 0, 16, 16, "img2.png", false, parentImage) -- Disable call propagation setElementCallPropagationEnabled(parentImage, false) -- Load another image guiStaticImageLoadImage(parentImage, "img3.png") --[[ Normally (enabled call propagation) both parentImage and childImage would contain "img3.png" now. Due to disabled call propagation only parentImage will contain "img3.png" now (the call was not propagated down the tree) ]]
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace