Created
June 3, 2014 01:41
-
-
Save veeneck/3411d26e9d01630b1c48 to your computer and use it in GitHub Desktop.
Adding light to Sprite Kit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SKLightNode* sun = [[SKLightNode alloc] init]; | |
sun.position = CGPointMake(500,500); | |
// These 3 lines are critical | |
sun.enabled = YES; // Toggles the light source on and off. | |
sun.categoryBitMask = 1; // Defines the category of this light source. | |
[your_scene addChild:sun]; // Must be added to the world to work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment