How to blend shapes. Now that we know how to add shapes to a scene, let’s look at different ways to blend the objects. Keep in mind that the order the elements are added to the scene impacts the blending of the objects. There are many modes available from blendmode such as: ADD, MULTIPLY, SRC_ATOP, SRC_OVER, SCREEN
- [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, New Project, Next.…We'll call it BlendedShapes.…
- What is JavaFX?
- Creating a simple JavaFX program
- Drawing lines, shapes, and text
- Applying effects
- Adding and animating images and charts
- Customizing interfaces with CSS
Skill Level Intermediate
1. Get Started with JavaFX
2. Sample Applications
4. User Interface Components
6. Custom UIs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.