Skip to content

Commit

Permalink
Merge remote branch 'refs/remotes/LamPham/develop' into gles20
Browse files Browse the repository at this point in the history
Conflicts:
	cocos2d-ios.xcodeproj/project.pbxproj
	cocos2d/CCProgressTimer.m
  • Loading branch information
ricardoquesada committed Mar 8, 2011
2 parents c9016f2 + 8c1b4d8 commit 5ed354f
Show file tree
Hide file tree
Showing 17 changed files with 450 additions and 302 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ People/companies who were/are contributing code to cocos2d for iPhone (alphabeti
ccpCompOp, ccpLerp, ccpFuzzyEqual, ccpCompMult, ccpAngleSigned, ccpAngle,
ccpRotateByAngle, ccpLineIntersect
Author of sample "CocosDenshion - Fancy Rat Metering Demo"
Added BarMid to CCProgressTo
CCProgressTimer: Improved API
* Leonardo Kasperavičius (http://www.instantgames.com.br/):
original author of QuadParticleSystem class
Author of the original Bezier action
Expand Down Expand Up @@ -338,6 +340,7 @@ People/companies who were/are contributing code to cocos2d for iPhone (alphabeti
Texture fails gracefully if PVR image can't be loaded (patch)
* Patrick Wolowicz:
mkatlas: added artifact removal by copying borders to margins
FontLabel: supports parenthese and apostrophes when word wrapping.
* Paul Hampson (TBBle) (http://blog.tbble.org/)
CCSpriteFrameCache textureFileName is relative to path
CCSprite: correctly overrides setIsRelativeAnchorPoint
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
version 2.0-alpha XX-Apr-2011
. [NEW] RadialEffects: Improved API. Added new Effect: Mid Bar

version 1.0-rc - XX-Apr-2011
. [3RD] FontLabel: Fixes issues with wrapping and apostraphes and hyphens (issue #1124)

version 1.0-beta - 01-Mar-2011
. [NEW] Actions: Repeat and RepeatForEver has getter/setter for the inner action (issue #1110)
. [NEW] LayerGradient: Added "compressed interpolation" (default mode) in order to display all graident's colors in any vector
. [NEW-MAC] Added CC_DIRECTOR_INIT(). It is possible to create a Mac Window programatically
. [NEW-MAC] EventDispatcher: Added support for touches events
. [NEW-MAC] EventDispatcher: Added support for Touch events
. [FIX] CocosDenshion: Improved logging
. [FIX] CocosDenshion: Fixed excessively large or negative gain values cause distorted audio in the simulator.
. [FIX] CocosDenshion: Added guards to prevent memory corruption caused by invalid parameters
. [FIX] CocosDenshion: Define some constants for defaults, make const parameter on buffer asynch load method
. [FIX] CCArray: insertObjectAtIndex checks bounds (issue #1121)
. [FIX] Director: Fixed possible crash when purging the TextureCache
. [FIX] Layer: Deprecated. CCMultiplexLayer deprecated. New name is CCLayerMultiplex
. [FIX] Layer: CCMultiplexLayer deprecated. New name is CCLayerMultiplex
. [FIX] Particles: consumes less memory (12 bytes less per particle) and are a bit faster
. [FIX] ProgressTimer: Consumes less memory
. [FIX] RenderTexture: Added possibility to save buffer in any place (issue #1100)
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===== cocos2d for iPhone v0.99.5 Release Notes =====
===== cocos2d for iPhone 2.0.0 Release Notes =====


Please, see the online document:
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_99_5
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:2_0_0
Binary file added Resources/Fonts/MarkerFelt.ttc
Binary file not shown.
60 changes: 35 additions & 25 deletions cocos2d/CCProgressTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,9 @@
*/
typedef enum {
/// Radial Counter-Clockwise
kCCProgressTimerTypeRadialCCW,
/// Radial ClockWise
kCCProgressTimerTypeRadialCW,
/// Horizontal Left-Right
kCCProgressTimerTypeHorizontalBarLR,
/// Horizontal Right-Left
kCCProgressTimerTypeHorizontalBarRL,
/// Vertical Bottom-top
kCCProgressTimerTypeVerticalBarBT,
/// Vertical Top-Bottom
kCCProgressTimerTypeVerticalBarTB,
kCCProgressTimerTypeRadial,
/// Bar
kCCProgressTimerTypeBar,
} CCProgressTimerType;

/**
Expand All @@ -50,34 +42,52 @@ typedef enum {
The progress can be Radial, Horizontal or vertical.
@since v0.99.1
*/
@interface CCProgressTimer : CCNode
{
@interface CCProgressTimer : CCNode<CCRGBAProtocol> {
CCProgressTimerType type_;
float percentage_;
CCSprite *sprite_;

int vertexDataCount_;
ccV2F_C4B_T2F *vertexData_;
CGPoint midpoint_;
CGPoint barChangeRate_;
BOOL reverse_;
}

@property ccColor3B color;
@property GLubyte opacity;
/** Change the percentage to change progress. */
@property (nonatomic, readwrite) CCProgressTimerType type;
@property (nonatomic, readwrite) BOOL reverse;
@property (readonly) ccV2F_C4B_T2F *vertexData;
@property (readonly) int vertexDataCount;

/**
* Midpoint is used to modify the progress start position.
* If you're using radials type then the midpoint changes the center point
* If you're using bar type the the midpoint changes the bar growth
* it expands from the center but clamps to the sprites edge so:
* you want a left to right then set the midpoint all the way to ccp(0,y)
* you want a right to left then set the midpoint all the way to ccp(1,y)
* you want a bottom to top then set the midpoint all the way to ccp(x,0)
* you want a top to bottom then set the midpoint all the way to ccp(x,1)
*/
@property (nonatomic, readwrite) CGPoint midpoint;

/**
* This allows the bar type to move the component at a specific rate
* Set the component to 0 to make sure it stays at 100%.
* For example you want a left to right bar but not have the height stay 100%
* Set the rate to be ccp(0,1); and set the midpoint to = ccp(0,.5f);
*/
@property (nonatomic, readwrite) CGPoint barChangeRate;

/** Percentages are from 0 to 100 */
@property (nonatomic, readwrite) float percentage;

/** The image to show the progress percentage */
@property (nonatomic, readwrite, retain) CCSprite *sprite;


/** Creates a progress timer with an image filename as the shape the timer goes through */
+ (id) progressWithFile:(NSString*) filename;
/** Initializes a progress timer with an image filename as the shape the timer goes through */
- (id) initWithFile:(NSString*) filename;

/** Creates a progress timer with the texture as the shape the timer goes through */
+ (id) progressWithTexture:(CCTexture2D*) texture;
/** Creates a progress timer with the texture as the shape the timer goes through */
- (id) initWithTexture:(CCTexture2D*) texture;

/** Creates a progress timer with the sprite as the shape the timer goes through */
+ (id) progressWithSprite:(CCSprite*) sprite;
- (id) initWithSprite:(CCSprite*) sprite;
@end
Loading

0 comments on commit 5ed354f

Please sign in to comment.