void CalcRects() { int w; if (ScreeUtil.isLandscape()) { w = (int)(1f * Screen.height / 3); } else { w = (int)(1f * Screen.width / 3); } Rect lR = new Rect(0, Screen.height - w, w, w); Rect rR = new Rect(Screen.width - w, Screen.height - w, w, w); r5 = new Rect(lR); r6 = new Rect(rR); lR.y -= w; rR.y -= w; r3 = new Rect(lR); r4 = new Rect(rR); lR.y -= w; rR.y -= w; r1 = new Rect(lR); r2 = new Rect(rR); }
public void Draw() { if (levelWasInitialized) { if (ScreeUtil.isLandscape()) { DrawBorder(); } float a = (game.isHelp || game.IsPause ? 0.2f : 1); Draw(level.levelShape.matrix, a); if (!reloadField || reload.Dir == -1) { Draw(currentShape.matrix, a); } } }
void OnGUI() { field.Draw(); GUI.color = Color.white; if (game.IsPause) { pauseLabel.Draw(); } else { if (ScreeUtil.isLandscape()) { r = new Rect(field.groupRect.x + field.groupRect.width + 15, 15, 200, 20); } else { r = new Rect(field.groupRect.x + field.groupRect.width - 215, 15, 200, 20); } /////NEXT///// GUI.Label(r, "Next", labelStyle); r.y += betweenLabelSpace * 0.75f; if (field.nextShape != null) { for (int i = 0, k = 0; i < field.nextShape.xSize; i++) { for (int j = 0; j < field.nextShape.ySize; j++, k++) { nR = new Rect( r.x + (r.width - smallCube.width * field.nextShape.xSize) / 2 + i * smallCube.width, r.y + j * smallCube.height, smallCube.width, smallCube.height); if (field.nextShape.values[k]) { GUI.DrawTexture(nR, smallCube); } } } } r.y += 4 * smallCube.height + betweenLabelSpace * 0.05f; /////SCORES///// GUI.Label(r, "Scores", labelStyle); r.y += betweenLabelSpace / 2; GUI.Label(r, scores.Scores.ToString(), labelStyle); r.y += betweenLabelSpace; /////LEVEL///// GUI.Label(r, "Level", labelStyle); r.y += betweenLabelSpace / 2; GUI.Label(r, timer.currentLevel.ToString(), labelStyle); } }