public override void DrawScreen(GLEx g) { switch (type) { case 1: g.SetAntiAlias(true); g.DrawSixStart(LColor.yellow, 130, 100, 100); g.SetAntiAlias(false); break; } g.ResetColor(); }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { if (visible && goalPath != null) { g.SetLineWidth(lineWidth); g.GLBegin(GL.GL_LINE_STRIP); g.Draw(goalPath, color); g.GLEnd(); g.ResetLineWidth(); g.ResetColor(); } }
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 virtual void CreateUI(GLEx g) { if (!isVisible) { return; } this.Setup(); int pointsLength = points.Count; CycleProgress point; int index; int frameD; int indexD; float size = (pointsLength * this.trailLength); for (float i = -1, l = size; ++i < l && !this.stopped; ) { index = (int)(frame + i); if (index < pointsLength) { point = points[index]; } else { point = points[index - pointsLength]; } this.alpha = (i / (l - 1)); frameD = frame / (pointsLength - 1); indexD = (int)alpha; if (lineWidth > 0) { g.SetLineWidth(lineWidth); } if (scaleX != 1 || scaleY != 1) { g.Scale(scaleX, scaleY); } if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } g.SetColor(color); Step(g, point, indexD, frameD, color, alpha); g.ResetColor(); if (alpha > 0 && alpha < 1) { g.SetAlpha(1); } if (lineWidth > 0) { g.ResetLineWidth(); } if (scaleX != 1 || scaleY != 1) { g.Restore(); } } }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { LButton button = (LButton)component; if (buttonImage != null) { if (!button.IsEnabled()) { g.DrawTexture(buttonImage[3], x, y); } else if (button.IsTouchPressed()) { g.DrawTexture(buttonImage[2], x, y); } else if (button.IsTouchOver()) { g.DrawTexture(buttonImage[1], x, y); } else { if (type == 1) { g.DrawTexture(buttonImage[0], x, y, LColor.gray); } else { g.DrawTexture(buttonImage[0], x, y); } } } if (text != null) { LFont old = g.GetFont(); g.SetFont(font); g.SetColor(fontColor); g.DrawString( text, x + button.GetOffsetLeft() + (button.GetWidth() - font.StringWidth(text)) / 2, y + button.GetOffsetTop() + (button.GetHeight() - font.GetLineHeight()) / 2 + font.GetLineHeight()); g.SetFont(old); g.ResetColor(); } }
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); } }
protected override void CreateCustomUI(GLEx g, int x, int y, int w, int h) { if (!visible) { return; } LFont oldFont = g.GetFont(); g.SetFont(messageFont); print.Draw(g, fontColor); g.SetFont(oldFont); if (print.IsComplete() && animation != null) { if (animation.GetSpriteImage() != null) { g.SetAlpha(1.0F); UpdateIcon(); g.DrawTexture(animation.GetSpriteImage(), dx, dy); } } g.ResetColor(); }