【发布时间】:2017-02-16 22:20:50
【问题描述】:
我正在尝试从 ArrayList 中获取位图图像并随机生成它们的网格以用于 netwalk 游戏。我在与我的 GameView 类分开的另一个类中有这个方法:
public int getGridElem(int x, int y) {
if (x < 0 || y < 0 || x >= mColumns || y >= mRows) {
throw new IndexOutOfBoundsException("The coordinates (" + x + ", " + y + ") are not valid.");
}
return mGrid[gridPos(x, y)];
}
我正在努力研究如何使用这个类来显示 ArrayList 中图像的随机网格?
【问题讨论】:
标签: android android-canvas android-custom-view android-bitmap