Commits

Anonymous committed 5471305

Removed need to modify file before use

Comments (0)

Files changed (1)

CCScrollingLabel.m

 
 #import "CCScrollingLabel.h"
 
-#define DEFAULT_LABEL_BUFFER_SPACE 20   
-#define DEFAULT_DELAY 2.0f
-#define DEFAULT_PIXELS_PER_SECOND 30
-
 @implementation CCScrollingLabel
 @synthesize pauseInterval;
 @synthesize bufferSpaceBetweenLabels;
 	}
 	
 	scrollDirection =  LEFT;
-	scrollSpeed = DEFAULT_PIXELS_PER_SECOND;
-	pauseInterval = DEFAULT_DELAY;
-	bufferSpaceBetweenLabels = DEFAULT_LABEL_BUFFER_SPACE;
+	scrollSpeed = 30;
+	pauseInterval = 2.0f;
+	bufferSpaceBetweenLabels = 20;
 	self.showsVerticalScrollIndicator = NO;
 	self.showsHorizontalScrollIndicator = NO;
 	self.userInteractionEnabled = NO;
 		frame.origin.x = offset;
 		label[i].frame = frame;
 		
-		offset += label[i].frame.size.width + DEFAULT_LABEL_BUFFER_SPACE;
+		offset += label[i].frame.size.width + bufferSpaceBetweenLabels;
 	}
 	
-	self.contentSize = CGSizeMake(label[0].frame.size.width + self.frame.size.width + DEFAULT_LABEL_BUFFER_SPACE,
+	self.contentSize = CGSizeMake(label[0].frame.size.width + self.frame.size.width + bufferSpaceBetweenLabels,
 							 self.frame.size.height);
 	
 	[self setContentOffset:CGPointMake(0,0) animated:NO];
 	if (scrollDirection == LEFT) {
 		self.contentOffset = CGPointMake(0,0);
 	} else {
-		self.contentOffset = CGPointMake(label[0].frame.size.width+DEFAULT_LABEL_BUFFER_SPACE, 0);
+		self.contentOffset = CGPointMake(label[0].frame.size.width+bufferSpaceBetweenLabels, 0);
 	}
 	
 	[UIView beginAnimations:@"scroll" context:nil];
 	[UIView setAnimationCurve:UIViewAnimationCurveLinear];
 	
 	if (scrollDirection ==  LEFT) {
-		self.contentOffset = CGPointMake(label[0].frame.size.width+DEFAULT_LABEL_BUFFER_SPACE, 0);
+		self.contentOffset = CGPointMake(label[0].frame.size.width+bufferSpaceBetweenLabels, 0);
 	} else {
 		self.contentOffset = CGPointMake(0,0);
 	}