<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/adding-text-to-a-scene",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Adding Text to a Scene"
}
-->

# Adding Text to a Scene

Draw text in your scene, such as a health indicator or a “Game Over” banner, by using a label node.

## Discussion

Most apps need to display text at some point, and implementing it correctly yourself can take a significant amount of work. But the [`SKLabelNode`](/documentation/SpriteKit/SKLabelNode) class does all of the work necessary to load fonts and create text for display.

Create a new label node by calling the [`labelNodeWithFontNamed:`](/documentation/SpriteKit/SKLabelNode/labelNodeWithFontNamed:) class method. Then configure the other label properties, especially the [`text`](/documentation/SpriteKit/SKLabelNode/text) property. The size of a label node is determined implicitly by its [`fontName`](/documentation/SpriteKit/SKLabelNode/fontName), [`fontSize`](/documentation/SpriteKit/SKLabelNode/fontSize), and [`text`](/documentation/SpriteKit/SKLabelNode/text) properties.

By default, the text label is centered horizontally on the label node’s origin, with the font’s baseline passing through the origin. The [`verticalAlignmentMode`](/documentation/SpriteKit/SKLabelNode/verticalAlignmentMode) and [`horizontalAlignmentMode`](/documentation/SpriteKit/SKLabelNode/horizontalAlignmentMode) properties can be used to adjust the label’s position relative to the origin. The following code demonstrates how to create a new text label.

```swift
let winner = SKLabelNode(fontNamed: "Chalkduster")
winner.text = "You Win!"
winner.fontSize = 65
winner.fontColor = SKColor.green
winner.position = CGPoint(x: frame.midX, y: frame.midY)
   
addChild(winner)
```

Whenever you change the label node’s properties, the label node is automatically updated the next time the scene is rendered.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)