Beispiel #1
0
        private void InitDesktop()
        {
            if (desktop != null && sprites != null)
            {
                return;
            }
            this.desktop = new Desktop(this, GetWidth(), GetHeight());
            this.sprites = new Sprites(GetWidth(), GetHeight());
            if (dialog == null)
            {
                LPixmap g = new LPixmap(GetWidth() - 20,
                                        GetHeight() / 2 - 20, true);
                g.SetAlphaValue(0, 0, 0, 125);
                g.FillRect(0, 0, g.GetWidth(), g.GetHeight());
                g.Dispose();
                dialog = g.Texture;
                g      = null;
            }
            this.message = new LMessage(dialog, 0, 0);
            this.message.SetFontColor(LColor.white);
            int size = message.GetWidth() / (message.GetMessageFont().GetSize());

            if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1)
            {
                if (size % 2 != 0)
                {
                    size = size + 2;
                }
                else
                {
                    size = size + 3;
                }
            }
            else
            {
                if (size % 2 != 0)
                {
                    size = size - 3;
                }
                else
                {
                    size = size - 4;
                }
            }
            this.message.SetMessageLength(size);
            this.message.SetLocation((GetWidth() - message.GetWidth()) / 2,
                                     GetHeight() - message.GetHeight() - 10);
            this.message.SetVisible(false);
            this.select = new LSelect(dialog, 0, 0);
            this.select.SetLocation(message.X(), message.Y());
            this.scrCG = new AVGCG();
            this.desktop.Add(message);
            this.desktop.Add(select);
            this.select.SetVisible(false);
        }
Beispiel #2
0
 private void InitDesktop()
 {
     if (desktop != null && sprites != null)
     {
         return;
     }
     this.desktop = new Desktop(this, GetWidth(), GetHeight());
     this.sprites = new Sprites(GetWidth(), GetHeight());
     if (dialog == null)
     {
         LPixmap g = new LPixmap(GetWidth() - 20,
                 GetHeight() / 2 - 20, true);
         g.SetAlphaValue(0, 0, 0, 125);
         g.FillRect(0, 0, g.GetWidth(), g.GetHeight());
         g.Dispose();
         dialog = g.Texture;
         g = null;
     }
     this.message = new LMessage(dialog, 0, 0);
     this.message.SetFontColor(LColor.white);
     int size = message.GetWidth() / (message.GetMessageFont().GetSize());
     if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1)
     {
         if (size % 2 != 0)
         {
             size = size + 2;
         }
         else
         {
             size = size + 3;
         }
     }
     else
     {
         if (size % 2 != 0)
         {
             size = size - 3;
         }
         else
         {
             size = size - 4;
         }
     }
     this.message.SetMessageLength(size);
     this.message.SetLocation((GetWidth() - message.GetWidth()) / 2,
             GetHeight() - message.GetHeight() - 10);
     this.message.SetVisible(false);
     this.select = new LSelect(dialog, 0, 0);
     this.select.SetLocation(message.X(), message.Y());
     this.scrCG = new AVGCG();
     this.desktop.Add(message);
     this.desktop.Add(select);
     this.select.SetVisible(false);
 }