SKlabelNode custom font

点点圈 提交于 2020-01-13 20:32:27

问题


I know I can create a custom font using this code:

[UIFont fontWithName:@"bebas-neue" size:10];

But if I want to create an SKLabelNode, how can I set this as the font?

SKLabelNode only takes a string as the fontName.


回答1:


The procedure is essentially the same as for UIFont.

To do this from scratch, follow the same process as for adding a custom UIFont (described here), then just use:

[SKLabelNode labelNodeWithFontNamed:@"Font Name Here"]


来源:https://stackoverflow.com/questions/21368283/sklabelnode-custom-font

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!