Skip to content

henryeverett/SpriteBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SpriteBar - Draw your own progress bar in Sprite Kit.

This library is a convenient way to create your own SKSpriteNode progress bars in Apple's Sprite Kit. Simply pass in a Texture Atlas containing your sprites and SpriteBar will do the rest.

Features

  • Progress bar generation from SKTextureAtlas.
  • Automatically scales the animation, allowing you to provide as many frames as you want. From 2 to 100!
  • Finds the closest texture file to the percent provided.
  • Built in timer function starts animating the progress bar with your graphics.

Installation

Simply drag the SpriteBar folder into your project and use #import "SpriteBar.h". Make sure you have followed the naming convention for your texture frames: (you may specify a texure reference to replace progress using textureReference)

progress_0.png
progress_10.png
progress_20.png
progress_30.png
etc

Usage

// Init and add
SpriteBar *progressBar = [[SpriteBar alloc] initWithTextureAtlas:myCustomTextureAtlas];
progressBar.size = CGSizeMake(50, 50);
[self addChild:progressBar];

[progressBar setProgress:0.2];
// or
[progressBar setProgressWithValue:36 ofTotal:200];
// or
[progressBar startBarProgressWithTimer:10 target:self selector:@selector(timeOver)];

Credits & Contact

SpriteBar was created by Henry Everett
Twitter: @henryeverett
GitHub: henryeverett

Please fork and contribute to this project!

About

Draw your own progress bar in Sprite Kit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published