Exemplo n.º 1
0
 public void CreateUI(GLEx g)
 {
     if (!visible)
     {
         return;
     }
     if (stop)
     {
         return;
     }
     float op = (currentFrame / time);
     SetOpacity(op);
     if (opacity > 0)
     {
         byte a = (byte)(this.opacity * 255);
         g.FillRect(offsetX + this.X(), offsetY + this.Y(), width, height, new Color(color.R, color.G, color.B, a));
         return;
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 private void Step(GLEx g, CycleProgress e, int index, int frame_0,
         LColor color_1, float alpha_2)
 {
     switch (stepType)
     {
         case 0:
             g.FillOval(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight,
                     blockWidth, blockHeight);
             break;
         case 1:
             g.FillRect(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight,
                     blockWidth, blockHeight);
             break;
         case 2:
             if (last != null)
             {
                 float[] xs = { X() + last.x, X() + e.x };
                 float[] ys = { Y() + last.y, Y() + e.y };
                 g.DrawPolygon(xs, ys, 2);
             }
             last = e;
             break;
         case 3:
             if (last != null)
             {
                 g.DrawLine(X() + last.x, Y() + last.y, X() + e.x, Y() + e.y);
             }
             last = e;
             break;
         case 4:
             Step(g, e.x, e.y, e.progress, index, frame_0, color_1, alpha_2);
             break;
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 public override void Draw(GLEx g)
 {
     if (!running || !IsOnLoadComplete() || IsClose())
     {
         return;
     }
     if (scrCG == null)
     {
         return;
     }
     if (scrCG.sleep == 0)
     {
         scrCG.Paint(g);
         DrawScreen(g);
         if (desktop != null)
         {
             desktop.CreateUI(g);
         }
         if (sprites != null)
         {
             sprites.CreateUI(g);
         }
     }
     else
     {
         scrCG.sleep--;
         if (color != null)
         {
             float alpha = (float)(scrCG.sleepMax - scrCG.sleep)
                     / scrCG.sleepMax;
             if (alpha > 0 && alpha < 1.0)
             {
                 if (scrCG.getBackgroundCG() != null)
                 {
                     g.DrawTexture(scrCG.getBackgroundCG(), 0, 0);
                 }
                 Color c = g.GetColor();
                 g.SetColor(color.R, color.G, color.B, (byte)(alpha * 255));
                 g.FillRect(0, 0, GetWidth(), GetHeight());
                 g.SetColor(c);
             }
             else
             {
                 Color c = g.GetColor();
                 g.SetColor(color);
                 g.FillRect(0, 0, GetWidth(), GetHeight());
                 g.SetColor(c);
             }
         }
         if (scrCG.sleep <= 0)
         {
             scrCG.sleep = 0;
             color = null;
         }
         g.SetAlpha(1.0f);
     }
 }