Selaa lähdekoodia

Shortcut to remove all sprite children

deepnight 9 vuotta sitten
vanhempi
commit
6cc432f16d
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      h2d/Sprite.hx

+ 5 - 0
h2d/Sprite.hx

@@ -272,6 +272,11 @@ class Sprite {
 		}
 	}
 
+	public function removeChildren() {
+		while( numChildren>0 )
+			removeChild( getChildAt(0) );
+	}
+
 	// shortcut for parent.removeChild
 	public inline function remove() {
 		if( this != null && parent != null ) parent.removeChild(this);