Java 类javafx.scene.effect.Bloom 实例源码

项目:FXGLGames    文件:SpaceInvadersFactory.java   
@Spawns("Laser")
public Entity newLaser(SpawnData data) {
    Entity owner = data.get("owner");

    Entity bullet = Entities.builder()
            .type(BULLET)
            .at(owner.getCenter().add(-4.5, -20))
            .bbox(new HitBox(BoundingShape.box(9, 20)))
            .with(new CollidableComponent(true), new OwnerComponent(owner.getType()))
            .with(new OffscreenCleanControl(), new BulletControl(850))
            .build();

    Texture t = texture("laser2.png");
    t.relocate(-2, -20);

    EntityView view = new EntityView();
    view.addNode(t);
    view.setEffect(new Bloom(0.5));

    bullet.setView(view);

    return bullet;
}
项目:openjfx-8u-dev-tests    文件:CanvasEffects2App.java   
@Override
public Node drawNode() {
    Group group = new Group();
    final Canvas canvas = new Canvas(110, 110);
    GraphicsContext gc = canvas.getGraphicsContext2D();
    gc.setEffect(new Bloom() {

        {
            setThreshold(threshold);
        }
    });

    gc.setFill(Color.BLUE);
    gc.setFont(new Font(36));
    gc.fillText("Bloom", 5, 30);

    group.getChildren().add(canvas);

    return group;
}
项目:FXGLGames    文件:SpaceInvadersFactory.java   
@Spawns("Laser")
public Entity newLaser(SpawnData data) {
    Entity owner = data.get("owner");

    Entity bullet = Entities.builder()
            .type(BULLET)
            .at(owner.getCenter().add(-4.5, -20))
            .bbox(new HitBox(BoundingShape.box(9, 20)))
            .with(new CollidableComponent(true), new OwnerComponent(owner.getType()))
            .with(new OffscreenCleanControl(), new BulletControl(850))
            .build();

    Texture t = texture("laser2.png");
    t.relocate(-2, -20);

    EntityView view = new EntityView();
    view.addNode(t);
    view.setEffect(new Bloom(0.5));

    bullet.setView(view);

    return bullet;
}
项目:javafx8-gradient-builder    文件:GradientBuilderApp.java   
/**
 * Configures the header of the application.
 */
private void configureHeader() {
    ImageView iconImage = new ImageView(new Image(getClass().getResourceAsStream("/images/app-icon.png")));
    iconImage.setFitHeight(80);
    iconImage.setFitWidth(80);

    Text header = new Text("Gradient Builder");
    header.getStyleClass().add("app-header-text");

    HBox hb = new HBox();
    hb.setAlignment(Pos.CENTER_LEFT);
    hb.setSpacing(15);
    hb.setPadding(new Insets(10));
    hb.getChildren().addAll(iconImage, header);

    Bloom bloom = new Bloom();
    bloom.setThreshold(0.3);
    header.setEffect(bloom);

    StackPane background = new StackPane();
    background.getStyleClass().add("app-header");
    background.getChildren().addAll(hb);
    background.setPrefHeight(100);

    root.setTop(background);
}
项目:flexfx    文件:AnimatedNodeController.java   
public void initialise()
{
    circle1.setEffect(new Bloom());
    circle2.setEffect(new Glow());
    circle3.setEffect(new GaussianBlur());
}
项目:FXGLGames    文件:BulletControl.java   
@Override
public void onAdded(Entity entity) {
    velocity = entity.getControl(ProjectileControl.class).getVelocity();

    view.getView().setEffect(new Bloom());
}
项目:FXGLGames    文件:SeekerControl.java   
@Override
public void onAdded(Entity entity) {
    seeker.getView().setEffect(new Bloom(0.5));
    adjustVelocity(0.016);
}
项目:FXGLGames    文件:RunnerControl.java   
@Override
public void onAdded(Entity entity) {
    runner.getView().setEffect(new Bloom(0.5));

    bullets = FXGL.getApp().getGameWorld().getGroup(GeoWarsType.BULLET);
}
项目:FXGLGames    文件:PlayerControl.java   
@Override
public void onAdded(Entity entity) {
    player.getView().setEffect(new Bloom());
}
项目:FXGLGames    文件:WandererControl.java   
@Override
public void onAdded(Entity entity) {
    wanderer.getView().setEffect(new Bloom(0.5));
}
项目:FXGLGames    文件:BulletControl.java   
@Override
public void onAdded(Entity entity) {
    velocity = entity.getControl(ProjectileControl.class).getVelocity();

    view.getView().setEffect(new Bloom());
}
项目:FXGLGames    文件:SeekerControl.java   
@Override
public void onAdded(Entity entity) {
    seeker.getView().setEffect(new Bloom(0.5));
    adjustVelocity(0.016);
}
项目:FXGLGames    文件:RunnerControl.java   
@Override
public void onAdded(Entity entity) {
    runner.getView().setEffect(new Bloom(0.5));

    bullets = FXGL.getApp().getGameWorld().getGroup(GeoWarsType.BULLET);
}
项目:FXGLGames    文件:PlayerControl.java   
@Override
public void onAdded(Entity entity) {
    player.getView().setEffect(new Bloom());
}
项目:FXGLGames    文件:WandererControl.java   
@Override
public void onAdded(Entity entity) {
    wanderer.getView().setEffect(new Bloom(0.5));
}
项目:obdq    文件:SettingsPage.java   
private VBox getThemeButton(final String theme)
{
    VBox button =new VBox(); 
    if(theme.equals(ObdqProperties.defaultTheme))
    {
        button.setId("themeIconSelected");
    }
    else
    {
        button.setId("themeIcon");
        button.setOnMouseClicked(new EventHandler<MouseEvent>() 
        {
            @Override
            public void handle(MouseEvent event) 
            {
                SettingsUtils.changeStyle(theme,true);
            }
        });
    }
        ImageView themeButtonImage = new ImageView();
        themeButtonImage.setId("themeIconImage");
             Image image = new Image("file:///"+ObdqProperties.workingDirectoryPath+"/themes/"+theme+"/themeIcon.png");
        themeButtonImage.setImage(image);
        //Mask Shape
        Rectangle mask = new Rectangle();
         mask.setWidth(75);
         mask.setHeight(75);
         mask.setArcWidth(20);
         mask.setArcHeight(20);
        themeButtonImage.setClip(mask);
        Bloom bloom = new Bloom();
        bloom.setThreshold(0.7);
        DropShadow dropShadow2 = new DropShadow();
        dropShadow2.setOffsetX(6.0);
        dropShadow2.setOffsetY(4.0);
        themeButtonImage.setEffect(dropShadow2);

        Label name=new Label(theme);
      // name.setContentDisplay(ContentDisplay.CENTER);
        name.setId("themeIconLable");
        name.setEffect(bloom);

    button.getChildren().addAll(themeButtonImage,name);
    button.setAlignment(Pos.CENTER);

    return button;
}