JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

An effect that simulates a light source shining on the given content, which can be used to give flat objects a more realistic, three-dimensional appearance.

the code:

import javafx.scene.*;
import javafx.scene.text.*;
import javafx.scene.paint.*;
import javafx.scene.effect.*;
import javafx.scene.effect.light.*;

Text {
    effect: Lighting {
        light: DistantLight { azimuth: -135 }
        surfaceScale: 5
    }
    textOrigin: TextOrigin.TOP
    x: 10 y: 10
    content: "JavaFX!"
    fill: Color.RED
    font: Font.font(null, FontWeight.BOLD, 90);
}

produces:

Profile: common conditional effect

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicbumpInputEffecta Shadow effect with a radius of 10

The optional bump map input.

The optional bump map input. If not specified, a bump map will be automatically generated from the default input. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used to generate a default bump map.

a Shadow effect with a radius of 10  
publiccontentInputEffectnull

The content input for this Effect.

The content input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.

null  
publicdiffuseConstantNumber1.0

The diffuse constant.

The diffuse constant.

       Min: 0.0
       Max: 2.0
   Default: 1.0
  Identity: n/a
 

1.0  
publiclightLight

The light source for this Lighting effect.

publicspecularConstantNumber0.3

The specular constant.

The specular constant.

       Min: 0.0
       Max: 2.0
   Default: 0.3
  Identity: n/a
 

0.3  
publicspecularExponentNumber20.0

The specular exponent.

The specular exponent.

       Min:  0.0
       Max: 40.0
   Default: 20.0
  Identity:  n/a
 

20.0  
publicsurfaceScaleNumber1.5

The surface scale factor.

The surface scale factor.

       Min:  0.0
       Max: 10.0
   Default:  1.5
  Identity:  n/a
 

1.5  

Inherited Variables

Function Summary

Inherited Functions

javafx.scene.effect.Effect




Spec-Zone.ru - all specs in one place