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 />

Figure 4-9. Windowless <strong>Java</strong>FX application seen at the top; completed <strong>Java</strong> and <strong>Java</strong>FX code that achieves it seen in the IDE<br />

Now that you have explored the javafx.stage package, let’s examine the javafx.geometry package next!<br />

<strong>Java</strong>FX Bounds and Dimensions: Using javafx.geometry Classes<br />

Even though the term “geometry” technically applies to 2D and 3D assets, these are contained in a javafx.scene.shape<br />

package, which I covered earlier (see the section “Scene Subpackages: The 13 Other Scene Packages”). The javafx.<br />

geometry package could be considered more of a utility package, containing foundational classes for building 2D<br />

and 3D constructs from scratch. As such, the package offers classes such as a Bounds superclass and its BoundingBox<br />

subclass as well as Insets, Point2D, Point3D, Dimension2D, and Rectangle2D geometry content creation utility classes.<br />

All the classes in the javafx.geometry package, except the BoundingBox class, were extended directly from the<br />

java.lang.Object master class, meaning that they were each developed (coded) from scratch for providing points (also<br />

called vertices), rectangles, dimensions, boundaries, and insets (inside boundaries) for use as geometric utilities for<br />

<strong>Java</strong>FX application development.<br />

www.it-ebooks.info<br />

95

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

Saved successfully!

Ooh no, something went wrong!