Using Point light

The Light.Point class is just a simpler version of the spotlight. It allows you to set the location of the light source and its color. The point light is always directed down, perpendicular to the scene surface. Refer to the following screenshot:

Here is part of the sample, related to the created effect:

Light.Point light = new Light.Point(200, 150, 100, Color.WHITE);

Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);

Text text = new Text("Java FX");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 70));
Rectangle rect = new Rectangle(300, 200, Color.BLUE);

StackPane items = new StackPane(rect, text);
items.setEffect(lighting);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.181.47