Latest 0.3.0
Homepage https://github.com/iguanastudios/ISSpriteKit
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, SpriteKit
Authors

ISSpriteKit License MIT

Badge w/ Version
Badge w/ Platform

Sprite Kit helpers, extensions and utilities.

Installation

The best and easiest way is to use CocoaPods.

pod 'ISSpriteKit'

ISParallaxNode

Highly customizable node that simulates a parallax scroller.

  • It supports every scroll direction.
  • Velocity control (Points per second).

Usage

#import "MyScene.h"
#import "ISParallaxNode.h"

@interface MyScene ()
@property (strong, nonatomic) ISParallaxNode *parallaxNode;
@end

@implementation MyScene

- (id)initWithSize:(CGSize)size {
    if (self = [super initWithSize:size]) {
        self.parallaxNode = [[ISParallaxNode alloc] initWithImageNamed:@"Horizontal" direction:ISScrollDirectionLeft];
        [self addChild: self.parallaxNode];
    }

    return self;
}

- (void)update:(NSTimeInterval)currentTime {
    [self.parallaxNode update:currentTime];
}

@end

ISParallaxLayer

ISParallaxLayer can contain several ISParallaxNodes.

Usage

#import "MyScene.h"
#import "ISParallaxLayer.h"
#import "ISParallaxNode.h"

@interface MyScene ()
@property (strong, nonatomic) ISParallaxLayer *parallaxLayer;
@end

@implementation MyScene

- (id)initWithSize:(CGSize)size {
    if (self = [super initWithSize:size]) {
        self.parallaxLayer = [ISParallaxLayer node];

        ISParallaxNode *parallaxNodeRightDirection = [[ISParallaxNode alloc] initWithImageNamed:@"Horizontal"
                                                                             direction:ISScrollDirectionRight];
        [self.parallaxLayer addParallaxNode:parallaxNodeRightDirection];

        ISParallaxNode *parallaxNodeLeftDirection = [[ISParallaxNode alloc] initWithImageNamed:@"Horizontal"
                                                                            direction:ISScrollDirectionLeft];
        parallaxNodeLeftDirection.position = CGPointMake(0, self.frame.size.height / 2);
        [self.parallaxLayer addParallaxNode:parallaxNodeLeftDirection];

        [self addChild:self.parallaxLayer];
    }

    return self;
}

- (void)update:(NSTimeInterval)currentTime {
    [self.parallaxLayer update:currentTime];
}

@end

Check out the example project for more details.

Licence

ISSpriteKit is licensed under the MIT Licence.

Latest podspec

{
    "name": "ISSpriteKit",
    "version": "0.3.0",
    "license": "MIT",
    "summary": "Sprite Kit helpers, extensions and utilities.",
    "homepage": "https://github.com/iguanastudios/ISSpriteKit",
    "authors": {
        "Luis Flores": "[email protected]"
    },
    "source": {
        "git": "https://github.com/iguanastudios/ISSpriteKit.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "ISSpriteKit/*",
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "SpriteKit"
    ]
}

Pin It on Pinterest

Share This