Skip to content

Instantly share code, notes, and snippets.

@veeneck
Created June 3, 2014 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veeneck/3411d26e9d01630b1c48 to your computer and use it in GitHub Desktop.
Save veeneck/3411d26e9d01630b1c48 to your computer and use it in GitHub Desktop.
Adding light to Sprite Kit
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