<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -31,9 +31,11 @@
 
 /** creates a menu with it's items */
 + (id) menuWithItems: (MenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION;
++ (id) menuWithArray: (NSArray*) items;
 
 /** initializes a menu with it's items */
 - (id) initWithItems: (MenuItem*) item vaList: (va_list) args;
+- (id) initWithArray: (NSArray*) items;
 
 /** align items vertically */
 -(void) alignItemsVertically;</diff>
      <filename>cocos2d/Menu.h</filename>
    </modified>
    <modified>
      <diff>@@ -26,60 +26,75 @@
 
 @synthesize opacity;
 
-- (id) init
++(id) menuWithItems: (MenuItem*) item, ...
 {
-	NSException* myException = [NSException
-								exceptionWithName:@&quot;MenuInit&quot;
-								reason:@&quot;Use initWithItems instead&quot;
-								userInfo:nil];
-	@throw myException;
+  va_list args;
+  va_start(args,item);
+  
+  id s = [[[self alloc] initWithItems: item vaList:args] autorelease];
+  
+  va_end(args);
+  return s;
 }
 
-+(id) menuWithItems: (MenuItem*) item, ...
++(id) menuWithArray: (NSArray*) items
 {
-	va_list args;
-	va_start(args,item);
-	
-	id s = [[[self alloc] initWithItems: item vaList:args] autorelease];
-	
-	va_end(args);
-	return s;
+  return [[[self alloc] initWithArray: items] autorelease];  
+}
+
+- (id)init
+{
+  if( !(self=[super init]) )
+    return nil;
+  
+  // menu in the center of the screen
+  CGSize s = [[Director sharedDirector] winSize];
+  
+  // XXX: in v0.7, winSize should return the visible size
+  // XXX: so the bar calculation should be done there
+  CGRect r = [[UIApplication sharedApplication] statusBarFrame];
+  if([[Director sharedDirector] landscape])
+    s.height -= r.size.width;
+  else
+      s.height -= r.size.height;
+  position = cpv(s.width/2, s.height/2);
+
+  isTouchEnabled = YES;
+  selectedItem = -1; 
+    
+  return self;
 }
 
 -(id) initWithItems: (MenuItem*) item vaList: (va_list) args
 {
-	if( !(self=[super init]) )
-		return nil;
-	
-	// menu in the center of the screen
-	CGSize s = [[Director sharedDirector] winSize];
-	
-	// XXX: in v0.7, winSize should return the visible size
-	// XXX: so the bar calculation should be done there
-	CGRect r = [[UIApplication sharedApplication] statusBarFrame];
-	if([[Director sharedDirector] landscape])
-		s.height -= r.size.width;
-	else
-	    s.height -= r.size.height;
-	position = cpv(s.width/2, s.height/2);
-
-	isTouchEnabled = YES;
-	selectedItem = -1;
-	
-	int z=0;
-	
-	if (item) {
-		[self addChild: item z:z];
-		MenuItem *i = va_arg(args, MenuItem*);
-		while(i) {
-			z++;
-			[self addChild: i z:z];
-			i = va_arg(args, MenuItem*);
-		}
-	}
-//	[self alignItemsVertically];
-	
-	return self;
+  if( !(self=[self init]) )
+    return nil;
+  
+  int z=0;
+  
+  [self addChild: item z:z];
+  MenuItem *i = va_arg(args, MenuItem*);
+  while(i) {
+    z++;
+    [self addChild: i z:z];
+    i = va_arg(args, MenuItem*);
+  }
+//  [self alignItemsVertically];
+  
+  return self;
+}
+-(id) initWithArray: (NSArray*) items
+{
+  if( !(self=[self init]) )
+    return nil;
+  
+  int z=0;
+  
+  for(MenuItem* item in items) {
+    [self addChild: item z:++z];
+  }
+  
+  return self;
 }
 
 -(void) dealloc</diff>
      <filename>cocos2d/Menu.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6103341ddb683b5be98f529dd1507185e6d7dbbb</id>
    </parent>
  </parents>
  <author>
    <name>Scott Fleckenstein</name>
    <email>nullstyle@gmail.com</email>
  </author>
  <url>http://github.com/nullstyle/cocos2d-iphone/commit/ed8079e4ab543bfec051dba8759b18cd0d002ebd</url>
  <id>ed8079e4ab543bfec051dba8759b18cd0d002ebd</id>
  <committed-date>2009-03-29T20:19:59-07:00</committed-date>
  <authored-date>2009-03-29T20:19:59-07:00</authored-date>
  <message>Add array support to menu</message>
  <tree>165b576f302aeb937bba6ac84727e0bae15655f9</tree>
  <committer>
    <name>Scott Fleckenstein</name>
    <email>nullstyle@gmail.com</email>
  </committer>
</commit>
