Ganjira
Ganjira

Reputation: 976

SKSpriteNode setting color with UIColor

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 ;)

Upvotes: 4

Views: 4980

Answers (1)

Ivan Lesko
Ivan Lesko

Reputation: 1304

Use an SKColor instead of UIColor.

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

Upvotes: 4

Related Questions