use of ilargia.egdx.logicbricks.component.actuator.TextureActuator in project Entitas-Java by Rubentxu.
the class ActuatorEntity method addTextureActuator.
public ActuatorEntity addTextureActuator(Bounds bounds, int opacity, Boolean flipX, Boolean flipY, Color tint) {
TextureActuator component = (TextureActuator) recoverComponent(ActuatorComponentsLookup.TextureActuator);
if (component == null) {
component = new TextureActuator(bounds, opacity, flipX, flipY, tint);
} else {
component.actuator = (indexOwner) -> {
GameEntity owner = Indexed.getInteractiveEntity(indexOwner);
TextureView view = owner.getTextureView();
if (bounds != null)
view.bounds = bounds;
if (flipX != null)
view.flipX = flipX;
if (flipY != null)
view.flipY = flipY;
if (opacity != -1)
view.opacity = opacity;
if (tint != null)
view.tint = tint;
};
}
addComponent(ActuatorComponentsLookup.TextureActuator, component);
return this;
}
use of ilargia.egdx.logicbricks.component.actuator.TextureActuator in project Entitas-Java by Rubentxu.
the class ActuatorEntity method replaceTextureActuator.
public ActuatorEntity replaceTextureActuator(Bounds bounds, int opacity, Boolean flipX, Boolean flipY, Color tint) {
TextureActuator component = (TextureActuator) recoverComponent(ActuatorComponentsLookup.TextureActuator);
if (component == null) {
component = new TextureActuator(bounds, opacity, flipX, flipY, tint);
} else {
component.actuator = (indexOwner) -> {
GameEntity owner = Indexed.getInteractiveEntity(indexOwner);
TextureView view = owner.getTextureView();
if (bounds != null)
view.bounds = bounds;
if (flipX != null)
view.flipX = flipX;
if (flipY != null)
view.flipY = flipY;
if (opacity != -1)
view.opacity = opacity;
if (tint != null)
view.tint = tint;
};
}
replaceComponent(ActuatorComponentsLookup.TextureActuator, component);
return this;
}
use of ilargia.egdx.logicbricks.component.actuator.TextureActuator in project Entitas-Java by Rubentxu.
the class ActuatorSystem method execute.
@Override
public void execute(float deltaTime) {
for (ActuatorEntity e : groupTexture.getEntities()) {
if (e.getLink().isOpen) {
TextureActuator textureActuator = e.getTextureActuator();
textureActuator.actuator.execute(e.getLink().ownerEntity);
}
}
for (ActuatorEntity e : groupVelocity.getEntities()) {
if (e.getLink().isOpen) {
VelocityActuator velocityActuator = e.getVelocityActuator();
velocityActuator.actuator.execute(e.getLink().ownerEntity);
}
}
for (ActuatorEntity e : groupCamera.getEntities()) {
if (e.getLink().isOpen) {
CameraActuator cameraActuator = e.getCameraActuator();
cameraActuator.actuator.execute(e.getLink().ownerEntity);
}
}
for (ActuatorEntity e : groupEffect.getEntities()) {
if (e.getLink().isOpen) {
ParticleEffectActuator effectActuator = e.getParticleEffectActuator();
effectActuator.actuator.execute(e.getLink().ownerEntity);
}
}
}
Aggregations