28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4 ■ An Introduction to <strong>Java</strong>FX 8: Exploring the Capabilities of the <strong>Java</strong> 8 Multimedia Engine<br />

The SnapshotResult class (and, more important, the object created using this class) contains your resulting<br />

snapshot image data, the parameters that generated it, and the source node in the scene graph that it was generated<br />

from. For this reason, the three methods supported by the class should be obvious: the .getImage() method will get<br />

a snapshot image, the .getSource() method gets the source node information, and the .getSnapshotParameters()<br />

method will get the SnapshotParameters object contents.<br />

Scene Subpackages: The 13 Other Scene Packages<br />

You may be thinking, “Whew! That was a lot to cover in that javafx.scene package overview!,” and indeed the core<br />

javafx.scene package has a lot of classes in it, covering scene creation; scene graph organization; and scene utilities,<br />

such as lighting, cameras, cursors, and screenshots (or should we call these sceneshots?). There is a lot more in the<br />

javafx.scene package, in subpackages, as I call them, or packages that are below the javafx.scene package, referenced<br />

using another dot and another package name (description). In fact, there are 13 more javafx.scene packages (see in<br />

Table 4-1), covering things such as drawing, painting, charting, UI design, imaging, special effects, media (audio and<br />

video) playback, input-output, text, shapes (2D geometry), transforms, and web page (content created with HTML5,<br />

<strong>Java</strong>Script and CSS3) rendering. You are going to explore these scene package classes in this section.<br />

Table 4-1. Thirteen Second-Level <strong>Java</strong>FX Scene Subpackages, Their Primary Functions, and a Description of Classes<br />

Package Name Functions Description of Contents<br />

javafx.scene.canvas Drawing Canvas class (and Canvas object); for a custom drawing surface<br />

javafx.scene.chart Charting Chart classes: PieChart, LineChart, XYChart, BarChart, AreaChart,<br />

BubbleChart<br />

javafx.scene.control UI controls UI control classes: Button, Menu, Slider, Label, ScrollBar, TextField<br />

javafx.scene.effect Special effects Special effects classes: Glow, Blend, Bloom, Shadow,<br />

Reflection, MotionBlur<br />

javafx.scene.image imaging Digital imaging classes: Image, ImageView, WritableImageView,<br />

PixelFormat<br />

javafx.scene.input Input (Events) Classes related to getting input from the user into the <strong>Java</strong>FX application<br />

javafx.scene.layout UI layouts UI layout container classes: TilePane, GridPane, FlowPane, Border<br />

javafx.scene.media Media player Media playback classes: MediaPlayer, MediaView, Track,<br />

AudioTrack, AudioClip<br />

javafx.scene.paint Painting Paint classes: Paint, Color, LinearGradient, RadialGradient, Stop,<br />

Material, and so on<br />

javafx.scene.shape Geometry 2D and 3D geometry classes: Mesh, Shape, Shape3D, Arc, Circle,<br />

Line, Path, and so on<br />

javafx.scene.text Text and font Text rendering and font rendering classes: Font, Text, TextFlow,<br />

and so on<br />

javafx.scene.transform Transforms Transform classes: Transform, Scale, Rotate, Shear, Translate, Affine<br />

javafx.scene.web WebKit Web support classes: WebView, WebEvent, WebEngine, HTMLEditor<br />

82<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!