I used below cocos2d
code and worked:
CCSprite *sprite1 = [[CCSprite alloc] init];
sprite1.position = ccp(SW*0.1f, SH*0.82f);
sprite1.normalMapSpriteFrame = normalMap;
sprite1.effect = glass;
sprite1.colorRGBA = [CCColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.0f];
Now tried to port it to Swift, but getting error for colorRGBA
last line. Help me to get right code.
var sprite1 = CCSprite.node() as CCSprite
sprite1.position = ccp(SW*0.1, SH*0.82);
sprite1.normalMapSpriteFrame = normalMap;
sprite1.effect = glass;
sprite1.colorRGBA = ______ ?
Just created a new project with SpriteBuilder in Swift, tried this and all worked:
Maybe you need to look at official documentation or this answer about bridging headers? They will help you to use Objective-C classes in Swift.