Game Development Reference
In-Depth Information
The position's scale type can also be adjusted individually for each axis. By default, co-
ordinates are considered to be X in Points , but always scaling up on the iPad. This has the
effect that when you change the document to Document
Resolution
Tablet, the rel-
ative position of the node remains the same on tablet devices.
By default, SpriteBuilder assumes that Universal apps will want to treat the iPad screen
essentially as a roughly two times larger screen—the 1024 x 768 iPad point extents are 1.8
times wider and 2-4 times higher than a widescreen iPhone 5C/5S dimensions of 568 x
320. If that is not what you wish, you'll have to change node positions to X in UI Points
(see Figure 2-17 ) to actually allow you to cram more nodes onto the larger screen real es-
tate. In other words the player would actually be able to see more of the same world on an
iPad.
Figure 2-17 . The Position Type settings
The same UI point scaling type can also be applied to a node's scale property.
Finally, the percent of parent container settings is the most important and the most fre-
quently used setting for positions. It allows you to completely ignore most resolution-de-
pendent considerations. The most common use is to quickly center a node on the screen
regardless of the target device being a 3.5” or 4” iPhone or an iPad. Simply set the posi-
tion types for both coordinates to percent of parent container and enter 50% x 50%.
The Content Size property extends this scale type list by two additional settings: Width in-
set in points and Width inset in UI points, shown in Figure 2-18 . The difference between
regular and UI point scaling is the same as mentioned above. The inset changes the con-
tentSize from defining the actual width and height of the node to defining the distance
from the edges of the parent node.
Search WWH ::




Custom Search