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:
Light.Distant, Light.Point, Light.Spot
Modifier and Type | Field and Description |
---|---|
private DoubleProperty |
pointsAtX
The x coordinate of the direction vector for this light.
|
private DoubleProperty |
pointsAtY
The y coordinate of the direction vector for this light.
|
private DoubleProperty |
pointsAtZ
The z coordinate of the direction vector for this light.
|
private DoubleProperty |
specularExponent
The specular exponent, which controls the focus of this
light source.
|
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.
|
Modifier and Type | Method and Description |
---|---|
double |
getPointsAtX() |
double |
getPointsAtY() |
double |
getPointsAtZ() |
double |
getSpecularExponent() |
(package private) SpotLight |
impl_createImpl()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
(package private) void |
impl_update() |
DoubleProperty |
pointsAtXProperty() |
DoubleProperty |
pointsAtYProperty() |
DoubleProperty |
pointsAtZProperty() |
void |
setPointsAtX(double value) |
void |
setPointsAtY(double value) |
void |
setPointsAtZ(double value) |
void |
setSpecularExponent(double value) |
DoubleProperty |
specularExponentProperty() |
getX, getY, getZ, setX, setY, setZ, xProperty, yProperty, zProperty
colorProperty, effectDirtyProperty, getColor, impl_clearDirty, impl_getImpl, impl_isEffectDirty, impl_markDirty, impl_sync, setColor
private DoubleProperty pointsAtX
Min: n/a Max: n/a Default: 0.0 Identity: n/a
private DoubleProperty pointsAtY
Min: n/a Max: n/a Default: 0.0 Identity: n/a
private DoubleProperty pointsAtZ
Min: n/a Max: n/a Default: 0.0 Identity: n/a
private DoubleProperty specularExponent
Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0
public Spot()
public Spot(double x, double y, double z, double specularExponent, Color color)
x
- the x coordinate of the light positiony
- the y coordinate of the light positionz
- the z coordinate of the light positionspecularExponent
- the specular exponent, which controls the
focus of the light sourcecolor
- the color of the light@Deprecated SpotLight impl_createImpl()
impl_createImpl
in class Light.Point
public final void setPointsAtX(double value)
public final double getPointsAtX()
public final DoubleProperty pointsAtXProperty()
public final void setPointsAtY(double value)
public final double getPointsAtY()
public final DoubleProperty pointsAtYProperty()
public final void setPointsAtZ(double value)
public final double getPointsAtZ()
public final DoubleProperty pointsAtZProperty()
public final void setSpecularExponent(double value)
public final double getSpecularExponent()
public final DoubleProperty specularExponentProperty()
void impl_update()
impl_update
in class Light.Point