Overview
Represents a spot light source at a given position in 3D space, with configurable direction and focus.
the code:
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.effect.light.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.scene.text.*;
Group {
var t:Text;
content: [
Rectangle {
width: bind t.layoutBounds.width+30
height: bind t.layoutBounds.height+20
fill: Color.BLACK
},
t = Text {
effect: Lighting {
light: SpotLight {
x: 0 y: 100 z: 50
pointsAtX: 400 pointsAtY: 0 pointsAtZ: 0
specularExponent: 2
}
surfaceScale: 5
}
textOrigin: TextOrigin.TOP
x: 10 y: 10
content: "SpotLight"
fill: Color.RED
font: Font.font(null, FontWeight.BOLD, 90);
}
]
}
produces:
Profile: desktop
Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | pointsAtX | Number | ![]() | ![]() | ![]() | 0.0 |
The x coordinate of the direction vector for this light. ![]() The x coordinate of the direction vector for this light. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
public | pointsAtY | Number | ![]() | ![]() | ![]() | 0.0 |
The y coordinate of the direction vector for this light. ![]() The y coordinate of the direction vector for this light. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
public | pointsAtZ | Number | ![]() | ![]() | ![]() | 0.0 |
The z coordinate of the direction vector for this light. ![]() The z coordinate of the direction vector for this light. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
public | specularExponent | Number | ![]() | ![]() | ![]() | 1.0 |
The specular exponent, which controls the focus of this light source. ![]() The specular exponent, which controls the focus of this light source. Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.01.0 |
Inherited Variables
javafx.scene.effect.light.PointLight
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | x | Number | ![]() | ![]() | ![]() | 0.0 |
The x coordinate of the light position. ![]() The x coordinate of the light position. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
public | y | Number | ![]() | ![]() | ![]() | 0.0 |
The y coordinate of the light position. ![]() The y coordinate of the light position. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
public | z | Number | ![]() | ![]() | ![]() | 0.0 |
The z coordinate of the light position. ![]() The z coordinate of the light position. Min: n/a Max: n/a Default: 0.0 Identity: n/a0.0 |
javafx.scene.effect.light.Light
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | color | Color | ![]() | ![]() | ![]() | WHITE |
The color of the light source. ![]() The color of the light source. Min: n/a Max: n/a Default: Color.WHITE Identity: n/aWHITE |
Inherited Functions
javafx.scene.effect.light.PointLight
- public impl_getImpl() : com.sun.scenario.effect.light.Light
javafx.scene.effect.light.Light
- public abstract impl_getImpl() : com.sun.scenario.effect.light.Light