public void Draw(GLEx g, int x, int y) { LColor oldColor = g.GetColor(); g.SetColor(color); switch (style) { case 0: float alpha = 0.0f; int nx = x + width / 2 - (int)r * 4, ny = y + height / 2 - (int)r * 4; g.Translate(nx, ny); for (IIterator it = new IteratorAdapter(list.GetEnumerator()); it.HasNext();) { RectBox s = (RectBox)it.Next(); alpha = alpha + 0.1f; g.SetAlpha(alpha); g.FillOval(s.x, s.y, s.width, s.height); } g.SetAlpha(1.0F); g.Translate(-nx, -ny); break; case 1: g.SetLineWidth(10); g.Translate(x, y); g.SetColor(Fill); g.DrawOval(0, 0, width, height); int sa = angle % 360; g.FillArc(x + (width - paintWidth) / 2, y + (height - paintHeight) / 2, paintWidth, paintHeight, sa, sa + ANGLE_STEP); g.Translate(-x, -y); g.ResetLineWidth(); break; } g.SetColor(oldColor); }
public void CreateUI(GLEx g) { if (!visible) { return; } if (complete) { return; } if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } if (count <= 1) { g.SetColor(color); g.FillRect(X(), Y(), width, height); g.ResetColor(); } else { g.SetColor(color); int length = (int)MathUtils.Sqrt(MathUtils.Pow(width / 2, 2.0f) + MathUtils.Pow(height / 2, 2.0f)); float x = X() + (width / 2 - length); float y = Y() + (height / 2 - length); float w = width / 2 + length - x; float h = height / 2 + length - y; float deg = 360f / this.div * this.count; g.FillArc(x, y, w, h, 0, this.sign[this.turn] * deg); g.ResetColor(); } if (alpha > 0 && alpha < 1) { g.SetAlpha(1f); } }
public void Draw(GLEx g, int x, int y) { switch (style) { case 0: Color oldColor = g.GetColor(); g.SetColor(color); float alpha = 0.0f; int nx = x + width / 2 - (int)r * 4, ny = y + height / 2 - (int)r * 4; g.Translate(nx, ny); for (IEnumerator <RectBox> it = list.GetEnumerator(); it.MoveNext();) { RectBox s = it.Current; alpha = alpha + 0.1f; g.SetAlpha(alpha); g.FillOval(s.x, s.y, s.width, s.height); } g.SetAlpha(1.0F); g.Translate(-nx, -ny); g.SetColor(oldColor); break; case 1: g.SetLineWidth(10); g.Translate(x, y); g.FillOval(0, 0, width, height, fill.Color); int sa = angle % 360; g.FillArc(x + (width - paintWidth) / 2, y + (height - paintHeight) / 2, paintWidth, paintHeight, sa, sa + ANGLE_STEP, Color.Red); g.Translate(-x, -y); g.ResetLineWidth(); break; } }