public override void Draw(GLEx g) { if (selected) { g.SetColor(255, 0, 0, 100); g.FillOval(-(range * 2 - Field.GetTileWidth()) / 2, -(range * 2 - Field.GetTileHeight()) / 2, this.range * 2 - 1, this.range * 2 - 1); g.SetColor(LColor.red); g.DrawOval(-(range * 2 - Field.GetTileWidth()) / 2, -(range * 2 - Field.GetTileHeight()) / 2, this.range * 2 - 1, this.range * 2 - 1); g.ResetColor(); } }
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); }