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 5 ■ An Introduction to Game Design: Concepts, Multimedia, and Using Scene Builder<br />

Next, let’s take a look at the tag and parameter syntax so that you always know how to construct FXML UI<br />

layout and control definition files. A UI element that has no children, such as the prior UI control, will use<br />

a shorthand tag open-and-close syntax, using the ), like this:<br />

<br />

Note that the parameters that configure the tag, which would equate to the attributes of the object (or the<br />

variables in the class that creates the object) are (yet again) nested inside the tag itself and use the variable name and<br />

equals operator, along with the data value specified in quotation marks, as shown in the previous code.<br />

A FXML tag that has objects nested inside it will use this different opening tag.<br />

Following the nested tags listed inside (after) this tag is a closing tag. This allows the tag syntax to<br />

specify (become) the container for the tags inside it, as you can see in the example here, in which the<br />

opening and closing FXML tags are ordered according to their nesting (inside) hierarchy:<br />

<br />

<br />

<br />

<br />

<br />

As you can see, the parameters can be put inside the opening tag for a parent tag by placing them between the<br />

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

Saved successfully!

Ooh no, something went wrong!