-
Notifications
You must be signed in to change notification settings - Fork 114
Annotations
Injects aspect-related types. See Dependency Injection for more info.
@AspectDescriptor(
all = {Scale.class, Tint.class},
exclude = Velocity.class)
private EntityTransmuter transmuter;
Ensuring removed components are retrievable until all SubscriptionListeners have been informed.
world.getAspectSubscriptionManager()
.get(Aspect.all(Renderable.class))
.addSubscriptionListener(new SubscriptionListener() {
@Override
public void inserted(IntBag entities) {}
@Override
public void removed(IntBag entities) {
for (int i = 0, s = entities.size(); s > i; i++) {
// without @DelayedCompoentRemoval on Renderable,
// this may be null
Renderable renderable = renderableMapper.get(entities.get(i));
}
}
});
Marks an int
or IntBag
fields as holding entities. Serialization and EntityLinkManager both use this annotation.
@PooledWeaver
public class InheritScale extends Component {
@EntityId public int target = -1;
}
Configures the method with which EntityLinkManager checks inter-entity relationships - on a per field basis.
public class ChildRenderable extends PooledComponent {
@EntityId @LinkPolicy(CHECK_SOURCE_AND_TARGETS)
public IntBag children = new IntBag();
}
Disables dependency injection for the current class or field.
@SkipWire
public class NoInjectSystem extends IteratingSystem {
Marks component as un-serializable. Transient component types are not included in the serialized output.
@Transient
public class Renderable extends Component {
public Sprite sprite;
}
Marker annotation.
Injecting objects registered with WorldConfiguration#register
:
@Wire(name = "ui.camera")
private OrthographicCamera camera;
Injecting fields inherited from parent classes:
@Wire(injectInherited = true)
public final class LayerHud extends AnimatedHudWidget<VisTable> {
For more options, see @Wire.
Annotations are processed by the maven or gradle plugin. Plugin setup is described on Bytecode weaving. All compile-time annotations work directly on class files. No source files are generated or modified.
Rewrites the component into a pooled component. Pooled components are managed by the world instance.
@PooledWeaver
public class Size extends Component {
public float width = 10;
public float height;
}
becomes:
public class Size extends PooledComponent {
public float width = 10;
public float height;
@Override
protected void reset() {
width = 10;
height = 0;
}
}
Annotation for preserving the access visibiliy of process(e)
. Necessary if an external class invokes the system's per entity-process method directly.
Profile system execution with custom profilers. Injects conditional profiler call at start of begin()
and before any exit point in end()
@Profile(enabled=true, using=SimpleProfiler.class)
public class ProfiledSystem extends IteratingSystem {
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference