Skip to content
Adrian Papari edited this page Aug 16, 2016 · 3 revisions

Fastest way of changing entity component compositions. Primarily useful when bootstrapping entities over several different managers/systems or when dealing with many entities at the same time (lightweight particle systems etc).

If you are just mutating single components use ComponentMapper instead; internally, they wrap a pair of transmuters for create/remove.

// initialize to a field
this.transmuter = new EntityTransmuterFactory(world)
			.add(Sprite.class)
			.add(Renderable.class)
			.remove(AssetReference.class)
			.build();

// apply transformation to entity
this.transmuter.transmute(entity);
Clone this wiki locally