use of com.almasb.fxgl.entity.component.ColorComponent in project FXGL by AlmasB.
the class AnimColorSample method initGame.
@Override
protected void initGame() {
Rectangle playerView = new Rectangle(40, 40);
Entity player = Entities.builder().at(100, 100).viewFromNode(playerView).with(new ColorComponent()).buildAndAttach();
playerView.fillProperty().bind(player.getComponent(ColorComponent.class).valueProperty());
Entities.animationBuilder().duration(Duration.seconds(2)).repeat(4).color(player).fromColor(Color.AQUA).toColor(Color.BURLYWOOD).buildAndPlay();
}
Aggregations