Example usage for javafx.scene.effect InnerShadow setOffsetY

List of usage examples for javafx.scene.effect InnerShadow setOffsetY

Introduction

In this page you can find the example usage for javafx.scene.effect InnerShadow setOffsetY.

Prototype

public final void setOffsetY(double value) 

Source Link

Usage

From source file:Main.java

static Node innerShadow() {
    InnerShadow is = new InnerShadow();
    is.setOffsetX(2.0f);//  www .  j  a  v  a  2s.co  m
    is.setOffsetY(2.0f);

    Text t = new Text();
    t.setEffect(is);
    t.setX(20);
    t.setY(100);
    t.setText("Inner Shadow");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 80));

    t.setTranslateX(300);
    t.setTranslateY(300);

    return t;
}

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*  w  ww . j ava2s  .c  o  m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());
    VBox root = new VBox();

    InnerShadow is = new InnerShadow();
    is.setOffsetX(4.0);
    is.setOffsetY(4.0);

    Text t = new Text();
    t.setEffect(is);
    t.setX(20);
    t.setY(100);
    t.setText("java2s.com");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font(null, FontWeight.BOLD, 80));

    root.getChildren().addAll(t);

    scene.setRoot(root);

    stage.setScene(scene);
    stage.show();
}