Class Light.Spot

java.lang.Object
Enclosing class:
Light

public static class Light.Spot extends Light.Point
Represents a spot light source at a given position in 3D space, with configurable direction and focus.

Example:


 Light.Spot light = new Light.Spot();
 light.setX(150);
 light.setY(100);
 light.setZ(80);
 light.setPointsAtX(0);
 light.setPointsAtY(0);
 light.setPointsAtZ(-50);
 light.setSpecularExponent(2);

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

 Text text = new Text();
 text.setText("Spot");
 text.setFill(Color.STEELBLUE);
 text.setFont(Font.font(null, FontWeight.BOLD, 80));
 text.setX(10.0);
 text.setY(10.0);
 text.setTextOrigin(VPos.TOP);
 text.setEffect(lighting);

 Rectangle rect = new Rectangle(200, 150);
 rect.setFill(Color.ALICEBLUE);
 rect.setEffect(lighting);
 

The code above produces the following:

The visual effect of spot Light
 on text

Since:
JavaFX 2.0