Преглед на файлове

Shortcut to remove all sprite children

deepnight преди 9 години
родител
ревизия
6cc432f16d
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  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
 	// shortcut for parent.removeChild
 	public inline function remove() {
 	public inline function remove() {
 		if( this != null && parent != null ) parent.removeChild(this);
 		if( this != null && parent != null ) parent.removeChild(this);