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; } }
public virtual void CreateUI(GLEx g) { if (isClose) { return; } if (replaceLoading) { if (replaceDstScreen == null || !replaceDstScreen.IsOnLoadComplete()) { Repaint(g); } else if (replaceDstScreen.IsOnLoadComplete()) { if (isScreenFrom) { Repaint(g); if (replaceDstScreen.color != null) { g.SetColor(replaceDstScreen.color); g.FillRect(dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); g.ResetColor(); } if (replaceDstScreen.currentScreen != null) { g.DrawTexture(replaceDstScreen.currentScreen, dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); } if (dstPos.X() != 0 || dstPos.Y() != 0) { g.SetClip(dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); g.Translate(dstPos.X(), dstPos.Y()); } replaceDstScreen.CreateUI(g); if (dstPos.X() != 0 || dstPos.Y() != 0) { g.Translate(-dstPos.X(), -dstPos.Y()); g.ClearClip(); } } else { if (replaceDstScreen.color != null) { g.SetColor(replaceDstScreen.color); g.FillRect(0, 0, GetWidth(), GetHeight()); g.ResetColor(); } if (replaceDstScreen.currentScreen != null) { g.DrawTexture(replaceDstScreen.currentScreen, 0, 0, GetWidth(), GetHeight()); } replaceDstScreen.CreateUI(g); if (color != null) { g.SetColor(color); g.FillRect(dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); g.ResetColor(); } if (GetBackground() != null) { g.DrawTexture(currentScreen, dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); } if (dstPos.X() != 0 || dstPos.Y() != 0) { g.SetClip(dstPos.X(), dstPos.Y(), GetWidth(), GetHeight()); g.Translate(dstPos.X(), dstPos.Y()); } Repaint(g); if (dstPos.X() != 0 || dstPos.Y() != 0) { g.Translate(-dstPos.X(), -dstPos.Y()); g.ClearClip(); } } } } else { Repaint(g); } }
private void Repaint(GLEx g) { if (isTranslate) { g.Translate(tx, ty); } if (isCamera) { if (camera != null) { g.Translate(-camera.cameraX, -camera.cameraY); } } AfterUI(g); if (fristPaintFlag) { fristOrder.Paint(g); } if (secondPaintFlag) { secondOrder.Paint(g); } if (lastPaintFlag) { lastOrder.Paint(g); } BeforeUI(g); if (isCamera) { if (camera != null) { g.Translate(camera.cameraX, camera.cameraY); } } if (isTranslate) { g.Translate(-tx, -ty); } }
protected override void CreateCustomUI(GLEx g, int x, int y, int w, int h) { if (!visible) { return; } PaintObjects(g, x, y, x + w, y + h); if (x == 0 && y == 0) { Paint(g); } else { g.Translate(x, y); Paint(g); g.Translate(-x, -y); } }
public void PaintObjects(GLEx g, int minX, int minY, int maxX, int maxY) { lock (objects) { g.BeginBatch(); IIterator it = objects.Iterator(); for (; it.HasNext(); ) { thing = (Actor)it.Next(); if (!thing.visible) { continue; } isListener = (thing.actorListener != null); if (isVSync) { if (isListener) { thing.actorListener.Update(elapsedTime); } thing.Update(elapsedTime); } RectBox rect = thing.GetRectBox(); actorX = minX + thing.GetX(); actorY = minY + thing.GetY(); actorWidth = rect.width; actorHeight = rect.height; if (actorX + actorWidth < minX || actorX > maxX || actorY + actorHeight < minY || actorY > maxY) { continue; } LTexture actorImage = thing.GetImage(); if (actorImage != null) { width = (actorImage.GetWidth() * thing.scaleX); height = (actorImage.GetHeight() * thing.scaleY); isBitmapFilter = (thing.filterColor != null); thing.SetLastPaintSeqNum(paintSeq++); angle = thing.GetRotation(); colorAlpha = thing.alpha; if (isBitmapFilter) { g.DrawBatch(actorImage, actorX, actorY, width, height, angle, thing.filterColor.Color); } else { if (colorAlpha != 1f) { g.SetAlpha(colorAlpha); } g.DrawBatch(actorImage, actorX, actorY, width, height, angle); if (colorAlpha != 1f) { g.SetAlpha(1f); } } } if (actorX == 0 && actorY == 0) { thing.Draw(g); if (isListener) { thing.actorListener.Draw(g); } } else { g.Translate(actorX, actorY); thing.Draw(g); if (isListener) { thing.actorListener.Draw(g); } g.Translate(-actorX, -actorY); } } g.EndBatch(); } }
public void CreateUI(GLEx g) { if (!visible) { return; } if (GetX() != 0 || GetY() != 0) { g.Translate(GetX(), GetY()); } Draw(g); if (GetX() != 0 || GetY() != 0) { g.Translate(-GetX(), -GetY()); } }