public static class Light.Point extends Light
Example:
Light.Point light = new Light.Point();
light.setX(100);
light.setY(100);
light.setZ(50);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("Point");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 80));
text.setX(10.0);
text.setY(10.0);
text.setTextOrigin(VPos.TOP);
Rectangle rect = new Rectangle(250, 150);
rect.setFill(Color.ALICEBLUE);
rect.setEffect(lighting);
text.setEffect(lighting);
The code above produces the following:
Light.Distant, Light.Point, Light.Spot
Constructor and Description |
---|
Point()
Creates a new instance of Point light with default parameters.
|
Point(double x,
double y,
double z,
Color color)
Creates a new instance of Point light with the specified x, y, x, and
color.
|
Modifier and Type | Method and Description |
---|---|
double |
getX() |
double |
getY() |
double |
getZ() |
void |
setX(double value) |
void |
setY(double value) |
void |
setZ(double value) |
DoubleProperty |
xProperty() |
DoubleProperty |
yProperty() |
DoubleProperty |
zProperty() |
colorProperty, getColor, setColor
public Point()
public Point(double x, double y, double z, Color color)
x
- the x coordinate of the light positiony
- the y coordinate of the light positionz
- the z coordinate of the light positioncolor
- the color of the lightpublic final void setX(double value)
public final double getX()
public final DoubleProperty xProperty()
public final void setY(double value)
public final double getY()
public final DoubleProperty yProperty()
public final void setZ(double value)
public final double getZ()
public final DoubleProperty zProperty()
Copyright © 2020. All rights reserved.