Game Development Reference
In-Depth Information
Figure 7-1 . A simple SKLabelNode example
As you can see, the SKLabelNode is pretty easy to use. Most of SKLabelNode 's
properties are straightforward, but there are a couple of properties that you may not have
seen. The two SKLabelNode properties are horizontalAlignmentMode and ho-
rizontalVerticalMode . Each of these properties is described in the following sec-
tions.
Changing the Horizontal Alignment of the Label
Node
SKLabelNode 's horizontalAlignmentMode is used to set the horizontal position
of the text relative to the node's position. There are three horizontal alignment options, all
of which are defined by the enum SKLabelHorizontalAlignmentMode . The three
options are SKLabelHorizontalAlignmentMode.Left , SKLabelHorizont-
Search WWH ::




Custom Search