Class Light.Spot
java.lang.Object
javafx.scene.effect.Light
javafx.scene.effect.Light.Point
javafx.scene.effect.Light.Spot
- Enclosing class:
- Light
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:
  
 
- Since:
- JavaFX 2.0
- 
Nested Class SummaryNested classes/interfaces declared in class javafx.scene.effect.LightLight.Distant, Light.Point, Light.Spot
- 
Property SummaryPropertiesTypePropertyDescriptionfinal DoublePropertyThe x coordinate of the direction vector for this light.final DoublePropertyThe y coordinate of the direction vector for this light.final DoublePropertyThe z coordinate of the direction vector for this light.final DoublePropertyThe specular exponent, which controls the focus of this light source.Properties declared in class javafx.scene.effect.Light.Pointx, y, z
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal doubleGets the value of thepointsAtXproperty.final doubleGets the value of thepointsAtYproperty.final doubleGets the value of thepointsAtZproperty.final doubleGets the value of thespecularExponentproperty.final DoublePropertyThe x coordinate of the direction vector for this light.final DoublePropertyThe y coordinate of the direction vector for this light.final DoublePropertyThe z coordinate of the direction vector for this light.final voidsetPointsAtX(double value) Sets the value of thepointsAtXproperty.final voidsetPointsAtY(double value) Sets the value of thepointsAtYproperty.final voidsetPointsAtZ(double value) Sets the value of thepointsAtZproperty.final voidsetSpecularExponent(double value) Sets the value of thespecularExponentproperty.final DoublePropertyThe specular exponent, which controls the focus of this light source.Methods declared in class javafx.scene.effect.Light.PointgetX, getY, getZ, setX, setY, setZ, xProperty, yProperty, zPropertyMethods declared in class javafx.scene.effect.LightcolorProperty, getColor, setColor
- 
Property Details- 
pointsAtXThe x coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- See Also:
 
- 
pointsAtYThe y coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- See Also:
 
- 
pointsAtZThe z coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- See Also:
 
- 
specularExponentThe specular exponent, which controls the focus of this light source.Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0- Default value:
- 1.0
- See Also:
 
 
- 
- 
Constructor Details- 
Spotpublic Spot()Creates a new instance of Spot light with default parameters.
- 
SpotCreates a new instance of Spot light with the specified x, y, z, specularExponent, and color.- Parameters:
- x- the x coordinate of the light position
- y- the y coordinate of the light position
- z- the z coordinate of the light position
- specularExponent- the specular exponent, which controls the focus of the light source
- color- the color of the light
- Since:
- JavaFX 2.1
 
 
- 
- 
Method Details- 
setPointsAtXpublic final void setPointsAtX(double value) Sets the value of thepointsAtXproperty.- Property description:
- The x coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Parameters:
- value- the value for the- pointsAtXproperty
- See Also:
 
- 
getPointsAtXpublic final double getPointsAtX()Gets the value of thepointsAtXproperty.- Property description:
- The x coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Returns:
- the value of the pointsAtXproperty
- See Also:
 
- 
pointsAtXPropertyThe x coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- Returns:
- the pointsAtXproperty
- See Also:
 
- 
setPointsAtYpublic final void setPointsAtY(double value) Sets the value of thepointsAtYproperty.- Property description:
- The y coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Parameters:
- value- the value for the- pointsAtYproperty
- See Also:
 
- 
getPointsAtYpublic final double getPointsAtY()Gets the value of thepointsAtYproperty.- Property description:
- The y coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Returns:
- the value of the pointsAtYproperty
- See Also:
 
- 
pointsAtYPropertyThe y coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- Returns:
- the pointsAtYproperty
- See Also:
 
- 
setPointsAtZpublic final void setPointsAtZ(double value) Sets the value of thepointsAtZproperty.- Property description:
- The z coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Parameters:
- value- the value for the- pointsAtZproperty
- See Also:
 
- 
getPointsAtZpublic final double getPointsAtZ()Gets the value of thepointsAtZproperty.- Property description:
- The z coordinate of the direction vector for this light.
 Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Returns:
- the value of the pointsAtZproperty
- See Also:
 
- 
pointsAtZPropertyThe z coordinate of the direction vector for this light.Min: n/a Max: n/a Default: 0.0 Identity: n/a- Default value:
- 0.0
- Returns:
- the pointsAtZproperty
- See Also:
 
- 
setSpecularExponentpublic final void setSpecularExponent(double value) Sets the value of thespecularExponentproperty.- Property description:
- The specular exponent, which controls the focus of this
 light source.
 Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Parameters:
- value- the value for the- specularExponentproperty
- See Also:
 
- 
getSpecularExponentpublic final double getSpecularExponent()Gets the value of thespecularExponentproperty.- Property description:
- The specular exponent, which controls the focus of this
 light source.
 Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Returns:
- the value of the specularExponentproperty
- See Also:
 
- 
specularExponentPropertyThe specular exponent, which controls the focus of this light source.Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0- Default value:
- 1.0
- Returns:
- the specularExponentproperty
- See Also:
 
 
-