Difference between revisions of "Sprite:removeFromParent"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
 
If the sprite has a parent, removes the sprite from the child list of its parent sprite. This function is equilavent to:<br />
 
If the sprite has a parent, removes the sprite from the child list of its parent sprite. This function is equilavent to:<br />

Revision as of 07:27, 24 August 2018

Available since: Gideros 2011.6

Description


If the sprite has a parent, removes the sprite from the child list of its parent sprite. This function is equilavent to:

<pre><code>
function Sprite:removeFromParent()
local parent = self:getParent()
if parent ~= nil then
parent:removeChild(self)
end
end

</code></pre>

 Sprite:removeFromParent()