Example usage for javafx.scene.text Text setY

List of usage examples for javafx.scene.text Text setY

Introduction

In this page you can find the example usage for javafx.scene.text Text setY.

Prototype

public final void setY(double value) 

Source Link

Usage

From source file:Main.java

static Node gaussianBlur() {
    Text t2 = new Text();
    t2.setX(10.0f);//www.  jav  a 2 s.  co  m
    t2.setY(140.0f);
    t2.setCache(true);
    t2.setText("Gaussian Blur");
    t2.setFill(Color.RED);
    t2.setFont(Font.font("null", FontWeight.BOLD, 36));
    t2.setEffect(new GaussianBlur());
    return t2;
}

From source file:Main.java

static Node reflection() {
    Text t = new Text();
    t.setX(10.0f);/*w  w w . j av  a  2s.  co m*/
    t.setY(50.0f);
    t.setCache(true);
    t.setText("Reflections on JavaFX...");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 30));

    Reflection r = new Reflection();
    r.setFraction(0.7f);

    t.setEffect(r);

    t.setTranslateY(400);
    return t;
}

From source file:Main.java

static Node motionBlur() {
    Text t = new Text();
    t.setX(20.0f);// w ww. ja va2s  .  c om
    t.setY(80.0f);
    t.setText("Motion Blur");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 60));

    MotionBlur mb = new MotionBlur();
    mb.setRadius(15.0f);
    mb.setAngle(45.0f);

    t.setEffect(mb);

    t.setTranslateX(520);
    t.setTranslateY(100);

    return t;
}

From source file:Main.java

static Node perspective() {
    Group g = new Group();
    PerspectiveTransform pt = new PerspectiveTransform();
    pt.setUlx(10.0f);//from  ww  w.j a v a  2s  .c  om
    pt.setUly(10.0f);
    pt.setUrx(210.0f);
    pt.setUry(40.0f);
    pt.setLrx(210.0f);
    pt.setLry(60.0f);
    pt.setLlx(10.0f);
    pt.setLly(90.0f);

    g.setEffect(pt);
    g.setCache(true);

    Rectangle r = new Rectangle();
    r.setX(10.0f);
    r.setY(10.0f);
    r.setWidth(280.0f);
    r.setHeight(80.0f);
    r.setFill(Color.DARKBLUE);

    Text t = new Text();
    t.setX(20.0f);
    t.setY(65.0f);
    t.setText("Perspective");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 36));

    g.getChildren().add(r);
    g.getChildren().add(t);
    return g;
}

From source file:Main.java

static Node innerShadow() {
    InnerShadow is = new InnerShadow();
    is.setOffsetX(2.0f);//from  w  ww .  ja va 2 s  . c o 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

static Node displacementMap() {
    int w = 220;/*from w  w w.j av a2s.c o  m*/
    int h = 100;
    FloatMap map = new FloatMap();
    map.setWidth(w);
    map.setHeight(h);

    for (int i = 0; i < w; i++) {
        double v = (Math.sin(i / 50.0 * Math.PI) - 0.5) / 40.0;
        for (int j = 0; j < h; j++) {
            map.setSamples(i, j, 0.0f, (float) v);
        }
    }

    Group g = new Group();
    DisplacementMap dm = new DisplacementMap();
    dm.setMapData(map);

    Rectangle r = new Rectangle();
    r.setX(20.0f);
    r.setY(20.0f);
    r.setWidth(w);
    r.setHeight(h);
    r.setFill(Color.BLUE);

    g.getChildren().add(r);

    Text t = new Text();
    t.setX(40.0f);
    t.setY(80.0f);
    t.setText("Wavy Text");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font("null", FontWeight.BOLD, 36));

    g.getChildren().add(t);

    g.setEffect(dm);
    g.setCache(true);

    g.setTranslateX(400);
    g.setTranslateY(200);

    return g;
}

From source file:Main.java

static Node dropShadow() {
    Group g = new Group();
    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0f);/*w ww.j  av  a2s.  c  o m*/
    ds.setColor(Color.color(0.4f, 0.4f, 0.4f));

    Text t = new Text();
    t.setEffect(ds);
    t.setCache(true);
    t.setX(10.0f);
    t.setY(270.0f);
    t.setFill(Color.RED);
    t.setText("JavaFX drop shadow...");
    t.setFont(Font.font("null", FontWeight.BOLD, 32));

    DropShadow ds1 = new DropShadow();
    ds1.setOffsetY(4.0f);

    Circle c = new Circle();
    c.setEffect(ds1);
    c.setCenterX(50.0f);
    c.setCenterY(325.0f);
    c.setRadius(30.0f);
    c.setFill(Color.ORANGE);
    c.setCache(true);

    g.getChildren().add(t);
    g.getChildren().add(c);
    return g;
}

From source file:Main.java

static Node boxBlur() {
    Text t = new Text();
    t.setText("Blurry Text!");
    t.setFill(Color.RED);/* www.  ja v a2  s.  c o  m*/
    t.setFont(Font.font("null", FontWeight.BOLD, 36));
    t.setX(10);
    t.setY(40);

    BoxBlur bb = new BoxBlur();
    bb.setWidth(5);
    bb.setHeight(5);
    bb.setIterations(3);

    t.setEffect(bb);
    t.setTranslateX(300);
    t.setTranslateY(100);

    return t;
}

From source file:Main.java

static Node bloom() {
    Group g = new Group();

    Rectangle r = new Rectangle();
    r.setX(10);//from  ww  w  . ja v a  2  s  .  c o  m
    r.setY(10);
    r.setWidth(160);
    r.setHeight(80);
    r.setFill(Color.DARKBLUE);

    Text t = new Text();
    t.setText("Bloom!");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font("null", FontWeight.BOLD, 36));
    t.setX(25);
    t.setY(65);

    g.setCache(true);
    //g.setEffect(new Bloom());
    Bloom bloom = new Bloom();
    bloom.setThreshold(1.0);
    g.setEffect(bloom);
    g.getChildren().add(r);
    g.getChildren().add(t);
    g.setTranslateX(350);
    return g;
}

From source file:Main.java

static Node lighting() {
    Light.Distant light = new Light.Distant();
    light.setAzimuth(-135.0f);/*  w  w  w . j  a  v a2s .co m*/

    Lighting l = new Lighting();
    l.setLight(light);
    l.setSurfaceScale(5.0f);

    Text t = new Text();
    t.setText("JavaFX\nLighting!");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 70));
    t.setX(500.0f);
    t.setY(100.0f);
    t.setTextOrigin(VPos.TOP);

    t.setEffect(l);

    t.setTranslateX(0);
    t.setTranslateY(320);

    return t;
}