Breaking a 2D image
Hi,
I want to break images into pieces to make a puzzle game.I have tried with CGRectDivide method but having problem with the last parameter.
Also can anyone help me how to create and use the 2D array in Objective-C.
How can I access the index of particular array ??
I want to break images into pieces to make a puzzle game.I have tried with CGRectDivide method but having problem with the last parameter.
Also can anyone help me how to create and use the 2D array in Objective-C.
How can I access the index of particular array ??
For the second question, I would use NSArray / NSMutableArray if you don't care too much about speed. I guess in a puzzle game that's ok.
You can do like this (out of my head. the message names can differ a bit):
NSArray* myArr = [[NSArray alloc] initWithObjects:@"one", @"two", nil];
NSString* twoStr = [myArr objectAtIndex:1];
You can do like this (out of my head. the message names can differ a bit):
NSArray* myArr = [[NSArray alloc] initWithObjects:@"one", @"two", nil];
NSString* twoStr = [myArr objectAtIndex:1];

