public void OnReleased()
 {
     if (theBannerPanel != null)
     {
         theBannerPanel = null;
     }
 }
        private void CreateBannerUI()
        {
            // create UI using ColossalFramework UI classes
            UIView uiv = UIView.GetAView();

            if (uiv == null)
            {
                return;
            }

            //UISprite chirpSprite = (ChirpBannerSprite)uiv.AddUIComponent (typeof(ChirpBannerSprite));

            //UIComponent parent = UIView.Find("ChirpBannerSprite");
            theBannerPanel = (BannerPanel)uiv.AddUIComponent(typeof(BannerPanel));

            if (theBannerPanel != null)
            {
                //theBannerPanel.ScrollSpeed = CurrentConfig.ScrollSpeed;
                //byte bAlpha = (byte)(ushort)(255f * CurrentConfig.BackgroundAlpha);

                //theBannerPanel.BackgroundColor = new Color32(0, 0, 0, bAlpha);
                //theBannerPanel.FontSize = CurrentConfig.TextSize;
                theBannerPanel.SendToBack();

                // Tests for overlapping:
                //theBannerPanel.CreateBannerLabel("This is a really long chirp! really chirpy chirpy!", 481516);
                //theBannerPanel.CreateBannerLabel("OMG", 123456);
                //theBannerPanel.CreateBannerLabel("OMG1222222222222233333333", 1234567);
                //theBannerPanel.CreateBannerLabel("OMG22222222222 222222  4434", 12345678);
            }
        }
        private void CreateBannerUI()
        {
            // create UI using ColossalFramework UI classes
            UIView uiv = UIView.GetAView();

            if (uiv == null)
            {
                return;
            }

            theBannerPanel = (BannerPanel)uiv.AddUIComponent(typeof(BannerPanel));

            if (theBannerPanel != null)
            {
                //theBannerPanel.ScrollSpeed = CurrentConfig.ScrollSpeed;
                //byte bAlpha = (byte)(ushort)(255f * CurrentConfig.BackgroundAlpha);

                //theBannerPanel.BackgroundColor = new Color32(0, 0, 0, bAlpha);
                //theBannerPanel.FontSize = CurrentConfig.TextSize;
                theBannerPanel.Initialize();

                // add mouse click handler to us here
                //theBannerPanel.eventClick += BannerPanel_eventClick;
                theBannerPanel.eventMouseUp += BannerPanel_eventMouseUp;
            }
        }