我正在做单词搜索益智游戏..我想生成10 * 10矩阵形式的大约15个单词。每个平方都是UIButton。在每个按钮上都会有单词的字符。
单词应该垂直排列,水平排列,交叉排列。
如何生成这个特定的矩阵?
任何人分享我的想法或代码等。
谢谢,凯尤尔·普拉贾帕蒂
发布于 2011-11-17 17:59:05
Rather than button use uiimageview, it will be easy as u can implement the sliding effect as well.
U need to implement different classes as Matrix, Plate, Coordinate, BoardManager. Now you have implement the logic arround this class.
.h matrix class
int row; int column; NSMutableArray *matrix;
.h plate class
Coordinate *currentCordinate; //center coordinate of the plate.
int presentRow; int presentCol;
.h BoardManager
NSInteger boardMatrixRow; NSInteger boardMatrixColumn;
.h Coordinate
CGFloat x; CGFloat y;
Now implement the methods and apply your logic of inserting the object into matrix array,assign the coordinates to the plates/image, tagging the image.
As such no tutorial encountered.
https://stackoverflow.com/questions/8164668
复制相似问题