Difference between revisions of "Sprite:removeFromParent"

From GiderosMobile
Line 19: Line 19:
 
  Sprite:removeFromParent()
 
  Sprite:removeFromParent()
 
</source>
 
</source>
 +
 +
{{Sprite}}

Revision as of 00:14, 4 December 2019


Available since: Gideros 2011.6
Class: Sprite

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()