public MessagePanel(Game game, Rectangle screen)
            : base(game)
        {
            graphicsCollection = (GraphicsCollection)Game.Services.GetService(typeof(GraphicsCollection));

            Color AlphaZero = new Color(99, 99, 99, 0);//Alpha = 0

            BgSprite            = new Sprite(game, graphicsCollection[graphicsCollection.GetPackIndex("pixel")].Frames);
            BgSprite.XRelative  = 0;
            BgSprite.YRelative  = 0;
            BgSprite.Tint       = AlphaZero;
            BgSprite.Width      = screen.Width;
            BgSprite.Height     = screen.Height;
            BgSprite.StackOrder = 1;

            PanelSprite             = new Sprite(game, graphicsCollection[graphicsCollection.GetPackIndex("message_panel")].Frames);
            PanelSprite.XRelative   = Convert.ToInt32(BgSprite.Width / 2 - PanelSprite.Width / 2);
            PanelSprite.YRelative   = Convert.ToInt32(BgSprite.Height / 2 - PanelSprite.Height / 2);
            PanelSprite.FrameNumber = 0;
            PanelSprite.StackOrder  = 3;

            MessageSpriteText            = new SpriteText(game, FontsCollection.GetPack("Calibri 10").Font);
            MessageSpriteText.MaxLength  = 500;
            MessageSpriteText.Tint       = Color.WhiteSmoke;
            MessageSpriteText.XRelative  = PanelSprite.XRelative + HPadding;
            MessageSpriteText.YRelative  = PanelSprite.YRelative + VPadding;
            MessageSpriteText.Text       = "";
            MessageSpriteText.StackOrder = 5;
            MessageSpriteText.Visible    = false;

            btnOK            = new MessagePanelOKButton(game);
            btnOK.XRelative  = Convert.ToInt32(PanelSprite.XRelative + PanelSprite.Width / 2 - btnOK.Width / 2);
            btnOK.YRelative  = Convert.ToInt32(PanelSprite.YRelative + PanelSprite.Height - btnOK.Height / 2 - 40);
            btnOK.OnRelease += new EventHandler <ButtonEventArgs>(btnOK_OnRelease);
            btnOK.StackOrder = 7;
            btnOK.Visible    = false;
            btnOK.Enabled    = false;

            tmrOpenPanel = new Timer(game);
            tmrOpenPanel.IntervalType = TimerIntervalType.Miliseconds;
            tmrOpenPanel.Interval     = 50;
            tmrOpenPanel.OnTick      += new EventHandler(tmrOpenPanel_OnTick);
            tmrOpenPanel.Start();

            AddChild(BgSprite);
            AddChild(PanelSprite);
            AddChild(MessageSpriteText);
            AddChild(btnOK);

            ((DisplayManager)Game.Services.GetService(typeof(DisplayManager))).CameraFreeze();
        }
        public MessagePanel(Game game, Rectangle screen)
            : base(game)
        {
            graphicsCollection = (GraphicsCollection)Game.Services.GetService(typeof(GraphicsCollection));

            Color AlphaZero = new Color(99, 99, 99, 0);//Alpha = 0

            BgSprite = new Sprite(game,graphicsCollection[graphicsCollection.GetPackIndex("pixel")].Frames);
            BgSprite.XRelative = 0;
            BgSprite.YRelative = 0;
            BgSprite.Tint = AlphaZero;
            BgSprite.Width = screen.Width;
            BgSprite.Height = screen.Height;
            BgSprite.StackOrder = 1;

            PanelSprite = new Sprite(game, graphicsCollection[graphicsCollection.GetPackIndex("message_panel")].Frames);
            PanelSprite.XRelative = Convert.ToInt32(BgSprite.Width / 2 - PanelSprite.Width / 2);
            PanelSprite.YRelative = Convert.ToInt32(BgSprite.Height / 2 - PanelSprite.Height / 2);
            PanelSprite.FrameNumber = 0;
            PanelSprite.StackOrder = 3;

            MessageSpriteText = new SpriteText(game, FontsCollection.GetPack("Calibri 10").Font);
            MessageSpriteText.MaxLength = 500;
            MessageSpriteText.Tint = Color.WhiteSmoke;
            MessageSpriteText.XRelative = PanelSprite.XRelative + HPadding;
            MessageSpriteText.YRelative = PanelSprite.YRelative + VPadding;
            MessageSpriteText.Text = "";
            MessageSpriteText.StackOrder = 5;
            MessageSpriteText.Visible = false;
            
            btnOK = new MessagePanelOKButton(game);
            btnOK.XRelative = Convert.ToInt32(PanelSprite.XRelative + PanelSprite.Width / 2 - btnOK.Width/2);
            btnOK.YRelative = Convert.ToInt32(PanelSprite.YRelative + PanelSprite.Height - btnOK.Height / 2 - 40);
            btnOK.OnRelease += new EventHandler<ButtonEventArgs>(btnOK_OnRelease);
            btnOK.StackOrder = 7;
            btnOK.Visible = false;
            btnOK.Enabled = false;

            tmrOpenPanel = new Timer(game);
            tmrOpenPanel.IntervalType = TimerIntervalType.Miliseconds;
            tmrOpenPanel.Interval = 50;
            tmrOpenPanel.OnTick += new EventHandler(tmrOpenPanel_OnTick);
            tmrOpenPanel.Start();
            
            AddChild(BgSprite);
            AddChild(PanelSprite);
            AddChild(MessageSpriteText);
            AddChild(btnOK);

            ((DisplayManager)Game.Services.GetService(typeof(DisplayManager))).CameraFreeze();
        }