Example #1
0
 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);
 }
Example #2
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);
                 }
                 LColor c = g.GetColor();
                 g.SetColor(color.R, color.G, color.B, (byte)(alpha * 255));
                 g.FillRect(0, 0, GetWidth(), GetHeight());
                 g.SetColor(c);
             }
             else
             {
                 LColor 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);
     }
 }
Example #3
0
        protected internal override void CreateCustomUI(GLEx g, int x, int y, int w, int h)
        {
            if (!visible)
            {
                return;
            }
            LColor oldColor = g.GetColor();
            LFont oldFont = g.GetFont();
            g.SetColor(fontColor);
            g.SetFont(messageFont);
            sizeFont = messageFont.GetSize();
            doubleSizeFont = sizeFont * 2;
            if (doubleSizeFont == 0)
            {
                doubleSizeFont = 20;
            }
            messageLeft = (x + doubleSizeFont + sizeFont / 2) + tmpOffset + left
                    + doubleSizeFont;
            // g.setAntiAlias(true);
            if (message != null)
            {
                messageTop = y + doubleSizeFont + top + 2;
                g.DrawString(message, messageLeft, messageTop);
            }
            else
            {
                messageTop = y + top + 2;
            }

            nTop = messageTop;
            if (selects != null)
            {
                nLeft = messageLeft - sizeFont / 4;
                for (int i = 0; i < selects.Length; i++)
                {
                    nTop += 30;
                    type = i + 1;
                    isSelect = (type == ((selectFlag > 0) ? selectFlag : 1));
                    if ((buoyage != null) && isSelect)
                    {
                        g.SetAlpha(autoAlpha);
                        g.DrawTexture(buoyage, nLeft,
                                nTop - (int)(buoyage.GetHeight() / 1.5f));
                        g.SetAlpha(1.0F);
                    }
                    g.DrawString(selects[i], messageLeft, nTop);
                    if ((cursor != null) && isSelect)
                    {
                        g.DrawTexture(cursor, nLeft, nTop - cursor.GetHeight() / 2, LColor.white);
                    }

                }
            }
            // g.setAntiAlias(false);
            g.SetColor(oldColor);
            g.SetFont(oldFont);

        }