SKSpriteNode setting color with UIColor

蹲街弑〆低调 提交于 2019-12-01 20:44:27

问题


I would like to set color of SKSpriteNode by Present Components Values of UIColor By Present Components Values of UIColor, I mean:

(UIColor *)blackColor
(UIColor *)blueColor
etc

The problem is that it doesn't work:

SKSpriteNode *noddd = [SKSpriteNode spriteNodeWithColor:blackColor size:CGSizeMake(50, 50);

Is there any possibility to do it?

Thanks in advance ;)


回答1:


Use an SKColor instead of UIColor.

SKSpriteNode *noddd = [SKSpriteNode spriteNodeWithColor:[SKColor blackColor] size:CGSizeMake(50, 50);


来源:https://stackoverflow.com/questions/22430743/skspritenode-setting-color-with-uicolor

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