Latest 0.1
Homepage https://github.com/nikhilbatra789/NBSpriteImage
License MIT
Platforms ios 8.0
Authors

CocoaPods Compatible
Platform iOS
License MIT

Screenshot

Introduction

NBSpriteImage is a small library to create and animate spriteImages from sprite sheet. It is fully customizable. You can fetch the sprite images from sprite sheet and customize your animation or directly animate them.

Requirements

  • iOS 8+
  • Xcode 9.0+

Installation

CocoaPods

Add the NBSpriteImage pod into your project and run pod install

pod 'NBSpriteImage'

Manual Install

Download NBSpriteImage and import NBSpriteImage.swift inside your xcode project.

Sample App

To start using NBSpriteImage you can build the provided example project

  1. Open Example/NBSpriteImage.xcodeproj in Xcode.
  2. Build and run.

Usage

It’s very easy to set up, just import NBSpriteImage in your Swift code:

import NBSpriteImage

Interface Builder:

Add an UIImageView with interface builder and link it with the outlet property declared in your code.

@IBOutlet private weak var imageView: UIImageView!

Then you can simply animate it using

self.imageView.animateWithSpriteSheet(spriteSheet: image, spriteSize: CGSize(width: 48, height: 48))

Here sprite size is the size of each sprite image.

FPS

By default fbs of animation will be 15 fps. If you want to change it you can change it by

self.imageView.animateWithSpriteSheet(spriteSheet: image, spriteSize: CGSize(width: 48, height: 48), fps: 30)

Range

If you want to run animation from a particular frame to a desired frame then you can do so by providing the range.

self.imageView.animateWithSpriteSheet(spriteSheet: image, spriteSize: CGSize(width: 48, height: 48), range: 0...31 , fps: 30)

License

NBSpriteImage is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NBSpriteImage",
    "version": "0.1",
    "summary": "A perfect way to animate sprte images from sprite sheet",
    "description": "NBSpriteImage is a small library to create and animate spriteImages from sprite sheet",
    "homepage": "https://github.com/nikhilbatra789/NBSpriteImage",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "nikhilbatra789": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nikhilbatra789/NBSpriteImage.git",
        "tag": 0.1
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "NBSpriteImage/Classes/**/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This