0
我做一個小地圖這樣的:小地圖造成的滯後
public void createMinimap() {
for (int i = 0; i < tilearray.size(); i++) {
float tileX = (200 * tilearray.get(i).getX())/(getmWidth() * 64);
float tileY = (100 * tilearray.get(i).getY())/(getmHeight() * 64);
final Rectangle tileRect = new Rectangle(tileX + 590, tileY + 380,
(64 * 200)/(getmWidth() * 64) + (float) 1, (64 * 100)
/(getmHeight() * 64) + (float) 1, vbom);
tileRect.setColor(Color.WHITE);
tileRect.setAlpha(.7f);
gameHUD.attachChild(tileRect);
mapRectArray.add(tileRect);
}
}
而當我有很多在tilearray元素,我的遊戲滯後一些。這是什麼原因?