Search code examples
objective-csprite-kittextkit

Text Kit with SKLabelNode


It seem not possible to use text kit, attributed string and layout manager with Sprit Kit SKLabelNode.

I wonder how Sprite Kit game display Long text which need to break into multiple line and Attributed String?


Solution

  • Attributed strings and line wrapping are not supported by SKLabelNode.

    I'm afraid if you need that it's up to you to implement it. You can use multiple label nodes to display multiple lines, and possibly write a custom tool that slices attributed, newline strings into multiple labels line-spaced and colored accordingly. Perhaps a library like that already exists.

    The alternative is to display a regular text view on top of the SKView.