public void SetLocation(int x, int y) { if (!visible) { return; } this.offsetX = x; this.offsetY = y; up.SetLocation((offsetX + up.GetWidth()) + offset, offsetY + (height - up.GetHeight() * 3) - offset); left.SetLocation((offsetX + 0) + offset, offsetY + (height - left.GetHeight() * 2) - offset); right.SetLocation((offsetX + right.GetWidth() * 2) + offset, offsetY + (height - right.GetHeight() * 2) - offset); down.SetLocation((offsetX + down.GetWidth()) + offset, offsetY + (height - down.GetHeight()) - offset); if (LSystem.screenRect.height >= LSystem.screenRect.width) { triangle.SetLocation(offsetX + (width - triangle.GetWidth() * 2) - offset, height - (triangle.GetHeight() * 4) - (offset * 2)); square.SetLocation(offsetX + (width - square.GetWidth()) - offset, height - (square.GetHeight() * 3) - (offset * 2)); circle.SetLocation(offsetX + (width - circle.GetWidth() * 3) - offset, height - (circle.GetHeight() * 3) - (offset * 2)); cancel.SetLocation(offsetX + (width - cancel.GetWidth() * 2) - offset, offsetY + height - (circle.GetHeight() * 2) - (offset * 2)); } else { triangle.SetLocation(offsetX + (width - triangle.GetWidth() * 2) - offset, height - (triangle.GetHeight() * 3) - offset); square.SetLocation(offsetX + (width - square.GetWidth()) - offset, height - (square.GetHeight() * 2) - offset); circle.SetLocation(offsetX + (width - circle.GetWidth() * 3) - offset, height - (circle.GetHeight() * 2) - offset); cancel.SetLocation(offsetX + (width - cancel.GetWidth() * 2) - offset, offsetY + height - (circle.GetHeight()) - offset); } }