This forum is read only and just serves as an archive. If you have any questions, please post them on

1 decade ago by OMATASE

I have a menu entity which needs to display more than one animation. I have encapsulated a character preview functionality in its own entity. The menu entity needs to show more than one character preview (which is an animation). I have the menu entity call to create the previews as needed.

What is the best way to remove these preview entities as my menu entity is getting removed? I looked but didn't see a method that calls when doing a removeEntity call.


1 decade ago by dominic

.spawnEntity returns the entity that was just created. You can use this to keep track of the entities you spawn from your menu to remove them again later.

previewEntities: [],

createrCharacterPreviews: function() {
	var ent = EntityPreview, x, y );
	this.previewEntities.push( ent );

kill: function() {
	// kill the menu itself
	// kill all entities that belong to that menu
	for( var i = 0; i < this.previewEntities.length; i++ ) {
Page 1 of 1
« first « previous next › last »