Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 18 ■ 3D Gameplay DesiGn: CreatinG your Game Content usinG Gimp anD Java

Your next step is to center this 432-pixel square image inside of the 512-pixel square area of your
quadrant’s texture map, which we will do before we copy it over, as this is an easier work process. To do this,
we’ll simply use the Image ➤ Canvas Size menu sequence and then increase the canvas size from 432x 432
to 512x 512. Make sure to click the dialog’s Center button or your image will be in the upper-left corner of
the resized canvas, this centering process will allow you to have transparency (alpha channel) values where
there was no image, which is exactly the result that we want to achieve.
As you can see in the Set Image Canvas Size dialog, once you click the Center button, shown in light
blue in Figure 18-5, the dialog will calculate the X Offset and Y Offset values (in this case, 40 pixels) around
the entire perimeter of the image, as in 512 – 432 = 80 / 2 = 40. Finally, click your Resize button to turn this
432-pixel square into a 512-pixel square, centered using transparency, so it will be centered in the steel hoop.
Now you’re ready to use Select ➤ All and then the Edit ➤ Copy menu sequence to place the data into the
Clipboard, where it will be pasted onto a different tab.


Figure 18-4. Use the Image ➤ Scale Image work process and reduce the 2160-pixel image 500 percent to be
432 pixels square

Free download pdf