Game Development Reference
In-Depth Information
Most of what you did here is similar to what you have been doing for all SCNNode object
types.
First you create an SCNText object by using the convenience init func-
tion. extrusionDepth refers to the depth of the letters.
chamferRadius is defaulted to 0.0. You change this to give a slight edge
to the letters in the text. Note that the maximum chamfer you can do is half
of the extrusionDepth value. If you exceed that amount, Scene Kit may
reduce the amount; it will also reduce the value if you use a thin stroke for
the text.
The flatness for the text refers to the accuracy of the text geometry. This is
how smooth the line looks to the user. By default this is set to 0.6.
The rest of the function contains everything already covered in previous
chapters of the topic.
In the viewDidLoad() function, simply add the textNode as a child node to the
scene's root node, after the createMainScene() function call:
scene.rootNode.addChildNode(createStartingText()) .
Summary
In this chapter, you learned more about how Scene Kit uses the tried-and-true scene graph
to render objects. You also dove into the primitive objects that are provided to you in the
Scene Kit library. You will expand on these primitives to create a simple yet interesting
game as you progress through the topic.
In the next chapter, you will learn how to manipulate the camera, which allows you to ma-
nipulate the point of view of the user. Another important item that you will examine closer
is how lighting is used and how it can totally change the look and feel of your game.
Search WWH ::




Custom Search