use of javafx.scene.effect.GaussianBlur in project bisq-desktop by bisq-network.
the class Transitions method removeEffect.
private void removeEffect(Node node, int duration) {
if (node != null) {
node.setMouseTransparent(false);
removeEffectTimeLine = new Timeline();
GaussianBlur blur = (GaussianBlur) node.getEffect();
if (blur != null) {
KeyValue kv1 = new KeyValue(blur.radiusProperty(), 0.0);
KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);
removeEffectTimeLine.getKeyFrames().add(kf1);
ColorAdjust darken = (ColorAdjust) blur.getInput();
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), 0.0);
KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);
removeEffectTimeLine.getKeyFrames().add(kf2);
removeEffectTimeLine.setOnFinished(actionEvent -> {
node.setEffect(null);
removeEffectTimeLine = null;
});
removeEffectTimeLine.play();
} else {
node.setEffect(null);
removeEffectTimeLine = null;
}
}
}
use of javafx.scene.effect.GaussianBlur in project OTP2_R6_svaap by JNuutinen.
the class Unit method drawShip.
/**
* Asettaa Unitin aluksen visuaalisia piirteitä.
* Käyttää Plarform.runLater kuvion asettamiseksi.
* @param shape Aluksen Shape-olio.
*/
void drawShip(Shape shape) {
this.shape = shape;
this.shape.setEffect(new GaussianBlur(2.0));
this.shape.setFill(Color.BLACK);
this.shape.setStrokeWidth(5.0);
Platform.runLater(() -> getChildren().add(this.shape));
this.shape.setStroke(color);
}
use of javafx.scene.effect.GaussianBlur in project OTP2_R6_svaap by JNuutinen.
the class LaserGun method buildChargingEffect.
/**
* Rakentaa latausefektin.
* @param color Efektin väri.
* @return Tehty efekti.
*/
private Circle buildChargingEffect(Color color) {
// Ammuksen muoto
chargingEffect = new Circle();
chargingEffect.setRadius(1);
Bloom bloom = new Bloom(0.0);
GaussianBlur blur = new GaussianBlur(6);
blur.setInput(bloom);
chargingEffect.setEffect(blur);
chargingEffect.setFill(Color.WHITE);
chargingEffect.setStroke(color);
chargingEffect.setStrokeWidth(1);
return chargingEffect;
}
use of javafx.scene.effect.GaussianBlur in project OTP2_R6_svaap by JNuutinen.
the class SmallProjectile method buildProjectile.
/**
* Rakentaa projectilen Polygonin
* @param speed Projectilen nopeus, vaikuttaa hännän pituuteen
* @param color Projectilen väri
* @return Rakennettu Polygon
*/
private Polygon buildProjectile(double speed, Color color) {
// Ammuksen muoto
Polygon shape = new Polygon();
shape.getPoints().addAll(-7.0, 2.5, -7.0, -2.5, 0.0, -6.0, // ammuksen hanta skaalautuu nopeuden mukaan, mutta on ainakin 7.0
speed * 0.4 + 7.0, // ammuksen hanta skaalautuu nopeuden mukaan, mutta on ainakin 7.0
0.0, 0.0, 6.0);
Bloom bloom = new Bloom(0.0);
GaussianBlur blur = new GaussianBlur(1.0);
blur.setInput(bloom);
// shape.setEffect(blur);
shape.setFill(Color.WHITE);
shape.setStroke(color);
shape.setStrokeWidth(3.0);
shape.getTransforms().add(new Rotate(180, 0, 0));
return shape;
}
Aggregations