Skip to content

Commit

Permalink
Merge pull request #1 from mobilejazz/master
Browse files Browse the repository at this point in the history
Maintaining returned image scale
  • Loading branch information
Rafal Sroka committed Aug 29, 2013
2 parents d78843f + 6a886e5 commit e10c626
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions UIImage+Sprite.h
Expand Up @@ -37,7 +37,7 @@
/**
The method returns an array with UIImages. Original sprite sheet is sliced into smaller chunks, each of the specified size.
@param image the image with sprite sheet (texture atlas)
@param size the size of the single chunk
@param size the size of the single chunk (in pixels)
@returns the array of UIImages, each representing a single animation frame
*/
+ (NSArray *)spritesWithSpriteSheetImage:(UIImage *)image spriteSize:(CGSize)size;
Expand All @@ -46,7 +46,7 @@
The method returns an array with UIImages. Original sprite sheet is sliced into smaller chunks, each of the specified size.
@param image the image with sprite sheet (texture atlas)
@param range the range of the chunks
@param size the size of the single chunk
@param size the size of the single chunk (in pixels)
@returns the array of UIImages, each representing a single animation frame
*/
+ (NSArray *)spritesWithSpriteSheetImage:(UIImage *)image inRange:(NSRange)range spriteSize:(CGSize)size;
Expand Down
2 changes: 1 addition & 1 deletion UIImage+Sprite.m
Expand Up @@ -84,7 +84,7 @@ + (NSArray *)spritesWithSpriteSheetImage:(UIImage *)image inRange:(NSRange)range
while (positionX < width) {

CGImageRef sprite = CGImageCreateWithImageInRect(spriteSheet, CGRectMake(positionX, positionY, size.width, size.height));
[tempArray addObject:[UIImage imageWithCGImage:sprite]];
[tempArray addObject:[UIImage imageWithCGImage:sprite scale:image.scale orientation:image.imageOrientation]];

CGImageRelease(sprite);

Expand Down

0 comments on commit e10c626

Please sign in to comment.