Java Reference
In-Depth Information
Figure 8-2. Gradient examples
Looking at the Proportional Linear example we can see that the gradient spans the entire square.
This is compared to the Fixed Width Linear example, which only draws the gradient within the region
specified. The two radial examples work in the same way—the proportional draws the gradient over the
entire square, while the fixed one is confined to the radius of the circle specified. Listing 8-1 shows the
code that created the examples.
Listing 8-1. Main.fx (partial)
function example():Void{
delete group.content;
var rect1 = Rectangle{
width: 100
height: 100
fill: LinearGradient{
Search WWH ::

Custom Search