Skip to content

Commit

Permalink
CCSpriteFrame: add name property. Part of #9
Browse files Browse the repository at this point in the history
  • Loading branch information
psineur committed Jan 28, 2012
1 parent 0bbe8f2 commit cacde93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cocos2d/CCSpriteFrame.h
Expand Up @@ -46,7 +46,13 @@
CGPoint offsetInPixels_;
CGSize originalSizeInPixels_;
CCTexture2D *texture_;

NSString *name_;
}

/** Name of the frame. Changed when frame added to CCSpriteFrameCache. */
@property (nonatomic, readwrite, copy) NSString *name;

/** rect of the frame in points. If it is updated, then rectInPixels will be updated too. */
@property (nonatomic,readwrite) CGRect rect;

Expand Down
1 change: 1 addition & 0 deletions cocos2d/CCSpriteFrame.m
Expand Up @@ -32,6 +32,7 @@
@implementation CCSpriteFrame
@synthesize rotated = rotated_, offsetInPixels = offsetInPixels_, texture = texture_;
@synthesize originalSizeInPixels=originalSizeInPixels_;
@synthesize name = name_;

+(id) frameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect
{
Expand Down

0 comments on commit cacde93

Please sign in to comment.