6
    let paragraph = NSMutableParagraphStyle()
    paragraph.alignment = NSTextAlignment.right
    paragraph.tailIndent = -3
    let shadow = NSShadow()
    shadow.shadowBlurRadius = 5
    shadow.shadowColor = UIColor.gray
    shadow.shadowOffset = CGSize(width: 2, height: -2)
    let text = NSMutableAttributedString(string: "MY LABEL", attributes:
   [NSShadowAttributeName : shadow,
    NSStrokeColorAttributeName : UIColor.black,
    NSStrokeWidthAttributeName : -3,
    NSForegroundColorAttributeName: UIColor.white,
    NSFontAttributeName : UIFont(name: "MyFont", size: 24) as Any,
    NSParagraphStyleAttributeName : paragraph])

    let node = SKLabelNode()
    addChild(node)
    node.attributedText = attributedString

It works but there is NO shadow. I can use the same NSMutableAttributedString on well-known ASAttributedLabel and it works nice and there IS a shadow, but i want to use SKLabelNode to achieve better performance on IOS11. ASAttributedLabel may lag on dynamic scenes :(

Kaushik Makwana
  • 1,329
  • 2
  • 14
  • 24
Anton Shevtsov
  • 190
  • 1
  • 11
  • Did you solve this problem? I'm in the same situation – user3582537 May 04 '20 at 21:00
  • it was a long time ago, but as far as I remember, I did not found any solution. but hey, it was iOS11 back then, maybe there is fresh workaround. sorry can't be more helpful – Anton Shevtsov May 05 '20 at 01:19
  • @user3582537, [What would be the best approach for outlining or dropshadowing a font?](https://stackoverflow.com/questions/19211827/what-would-be-the-best-approach-for-outlining-or-dropshadowing-a-font) – Asperi May 10 '20 at 12:59

0 Answers0