public static class Light.Distant extends Light
Example:
Light.Distant light = new Light.Distant();
light.setAzimuth(45.0);
light.setElevation(30.0);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("Distant");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font("null", FontWeight.BOLD, 80));
text.setX(10.0f);
text.setY(10.0f);
text.setTextOrigin(VPos.TOP);
text.setEffect(lighting);
Rectangle rect = new Rectangle(300,150);
rect.setFill(Color.ALICEBLUE);
rect.setEffect(lighting);
The code above produces the following:
Light.Distant, Light.Point, Light.Spot
Constructor and Description |
---|
Distant()
Creates a new instance of Distant light with default parameters.
|
Distant(double azimuth,
double elevation,
Color color)
Creates a new instance of Distant light with the specified azimuth,
elevation, and color.
|
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
azimuthProperty() |
DoubleProperty |
elevationProperty() |
double |
getAzimuth() |
double |
getElevation() |
void |
setAzimuth(double value) |
void |
setElevation(double value) |
colorProperty, getColor, setColor
public Distant()
public Distant(double azimuth, double elevation, Color color)
azimuth
- the azimuth of the lightelevation
- the elevation of the lightcolor
- the color of the lightpublic final void setAzimuth(double value)
public final double getAzimuth()
public final DoubleProperty azimuthProperty()
public final void setElevation(double value)
public final double getElevation()
public final DoubleProperty elevationProperty()
Copyright © 2020. All rights reserved.