Java Reference
In-Depth Information
Polygon {
Ellipse {
ShapeIntersect {
points : [
centerX: 85
fill: Color.PURPLE
10, 190
centerY: 190
a: [
80, 10
radiusX: 75
Polygon {
160, 190
radius: 20
points: [
]
fill: Color.PURPLE 10, 190
fill: Color.PURPLE
}
85, 10
}
160, 190
]
}
Ellipse {
centerX: 85
centerY: 190
radiusX: 75
radiusY: 20
}
]
Figure 6.10
Combining Two Basic Shapes Together to Form a Cone
Let's add a LinearGradient to the entire cone. The code describing our desired
fill pattern looks like this:
fill: LinearGradient {
startX: 30, startY: 190
endX: 190, endY: 170
proportional: false
stops: [
Stop { offset: 0.0 color: Color.PURPLE },
Stop { offset: 0.5 color: Color.WHITE },
Stop { offset: 1.0 color: Color.PURPLE },
]
}
This time, we set the proportional instance variable to false and use pixel coor-
dinates to specify the start and stop locations. To give a realistic perspective to
the cone, the LinearGradient is centered slightly to the right of the cone tip,
Search WWH ::




Custom Search