Class Light.Spot
- javafx.scene.effect.Light
-
- javafx.scene.effect.Light.Point
-
- javafx.scene.effect.Light.Spot
Enclosing class:
public static class Light.Spot extends Light.Point
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:
Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description DoublePropertypointsAtXThe x coordinate of the direction vector for this light.DoublePropertypointsAtYThe y coordinate of the direction vector for this light.DoublePropertypointsAtZThe z coordinate of the direction vector for this light.DoublePropertyspecularExponentThe specular exponent, which controls the focus of this light source.-
Properties inherited from class javafx.scene.effect.Light.Point
x, y, z
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javafx.scene.effect.Light
Light.Distant, Light.Point, Light.Spot
-
-
Constructor Summary
Constructors Constructor and Description Spot()Creates a new instance of Spot light with default parameters.Spot(double x, double y, double z, double specularExponent, Color color)Creates a new instance of Spot light with the specified x, y, z, specularExponent, and color.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description doublegetPointsAtX()Gets the value of the property pointsAtX.doublegetPointsAtY()Gets the value of the property pointsAtY.doublegetPointsAtZ()Gets the value of the property pointsAtZ.doublegetSpecularExponent()Gets the value of the property specularExponent.DoublePropertypointsAtXProperty()The x coordinate of the direction vector for this light.DoublePropertypointsAtYProperty()The y coordinate of the direction vector for this light.DoublePropertypointsAtZProperty()The z coordinate of the direction vector for this light.voidsetPointsAtX(double value)Sets the value of the property pointsAtX.voidsetPointsAtY(double value)Sets the value of the property pointsAtY.voidsetPointsAtZ(double value)Sets the value of the property pointsAtZ.voidsetSpecularExponent(double value)Sets the value of the property specularExponent.DoublePropertyspecularExponentProperty()The specular exponent, which controls the focus of this light source.-
Methods inherited from class javafx.scene.effect.Light.Point
getX, getY, getZ, setX, setY, setZ, xProperty, yProperty, zProperty
-
Methods inherited from class javafx.scene.effect.Light
colorProperty, getColor, setColor
-
-
Property Detail
-
pointsAtX
public final DoubleProperty pointsAtXProperty
The x coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
pointsAtY
public final DoubleProperty pointsAtYProperty
The y coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
pointsAtZ
public final DoubleProperty pointsAtZProperty
The z coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
specularExponent
public final DoubleProperty specularExponentProperty
The specular exponent, which controls the focus of this light source.Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0Default value:
1.0
See Also:
-
-
Constructor Detail
-
Spot
public Spot()
Creates a new instance of Spot light with default parameters.
-
Spot
public Spot(double x, double y, double z, double specularExponent, Color color)Creates a new instance of Spot light with the specified x, y, z, specularExponent, and color.Parameters:
x- the x coordinate of the light positionSince:
JavaFX 2.1
-
-
Method Detail
-
setPointsAtX
public final void setPointsAtX(double value)
Sets the value of the property pointsAtX.Property description:
The x coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
getPointsAtX
public final double getPointsAtX()
Gets the value of the property pointsAtX.Property description:
The x coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
pointsAtXProperty
public final DoubleProperty pointsAtXProperty()
The x coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
setPointsAtY
public final void setPointsAtY(double value)
Sets the value of the property pointsAtY.Property description:
The y coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
getPointsAtY
public final double getPointsAtY()
Gets the value of the property pointsAtY.Property description:
The y coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
pointsAtYProperty
public final DoubleProperty pointsAtYProperty()
The y coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
setPointsAtZ
public final void setPointsAtZ(double value)
Sets the value of the property pointsAtZ.Property description:
The z coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
getPointsAtZ
public final double getPointsAtZ()
Gets the value of the property pointsAtZ.Property description:
The z coordinate of the direction vector for this light.
Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
-
pointsAtZProperty
public final DoubleProperty pointsAtZProperty()
The z coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/aDefault value:
0.0
See Also:
-
setSpecularExponent
public final void setSpecularExponent(double value)
Sets the value of the property specularExponent.Property description:
The specular exponent, which controls the focus of this light source.
Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0Default value:
1.0
-
getSpecularExponent
public final double getSpecularExponent()
Gets the value of the property specularExponent.Property description:
The specular exponent, which controls the focus of this light source.
Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0Default value:
1.0
-
specularExponentProperty
public final DoubleProperty specularExponentProperty()
The specular exponent, which controls the focus of this light source.Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0Default value:
1.0
See Also:
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.