\n not working in Sklabel SpriteKit

前端 未结 4 2285
滥情空心
滥情空心 2021-02-20 10:53

I have been using the following code in my game. The Problem is that i am unable to make multi-line label in spritekit as i was able to do using CCLabelTTF...... Can Somebody he

4条回答
  •  借酒劲吻你
    2021-02-20 11:36

    I had the same problem. I created a drop-in replacement for SKLabelNode called DSMultilineLabelNode that supports word wrap, line breaks, etc. The underlying implementation draws the string into a graphics context and then applies that to a texture on an SKSpriteNode.

    It's available on GitHub at:

    https://github.com/downrightsimple/DSMultilineLabelNode

提交回复
热议问题