From the course: Learning JavaFX GUI Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Blend shapes

Blend shapes

From the course: Learning JavaFX GUI Development

Start my 1-month free trial

Blend shapes

- [Voiceover] Now that we know how to add shapes onto a scene, let's look at different ways to blend the shapes. There are many modes available in the BlendMode class in JavaFX, such as: ADD, which takes the color and alpha components from the top input and adds those to the bottom input. MULTIPLY, the color components from the first input are multiplied with those from the second input. SRC_ATOP, the part of the top input that lies inside of the bottom input is blended with the bottom input. SRC_OVER, the top input is blended over the bottom input. Note that for both SRC_ATOP and SRC_OVER, the order in which the nodes are added to the scene is important. And SCREEN, where the color components from both of the inputs are inverted, multiplied with each other, and that result is again inverted, to produce the resulting color. I know all of that's pretty confusing, so let's take a look at some examples. We're gonna switch over to NetBeans. In NetBeans, let's create a new project. File…

Contents