예제 #1
0
        static void GetNewAd()
        {
            if (AdShowing)
            {
                //AdSprite.Texture.Dispose();
            }

            if (AdSprite == null)
            {
                somaAd         = new SomaAd();
                somaAd.Adspace = 65737880;
                somaAd.Pub     = 923834393;

                AdSprite = new Sprite("ui/ui");
                AdSprite.Initialize(BaseGame.Get.Content);
                textureSomaAd = thisContent.Load <Texture2D>("sampleAd");

                AdSprite.Texture = textureSomaAd;
                AdSprite.Width   = 480 * 0.7f;
                AdSprite.Height  = 79 * 0.7f;
                AdSprite.Handle  = BaseSprite.SpriteHandle.BOTTOMCENTER;
            }
            AdShowing = false;
            somaAd.GetAd();
            timer = new System.Diagnostics.Stopwatch();
            timer.Start();

            AdDelayTillNext = BaseGame.Random.Next(20, 40);
        }
        /// <summary>
        /// Initializes the screen manager component.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            isInitialized = true;

            musicManager = new BackgroundMusicManager(Game);
            musicManager.PromptGameHasControl += MusicManagerPromptGameHasControl;
            musicManager.PlaybackFailed       += MusicManagerPlaybackFailed;
            Game.Components.Add(musicManager);

            Accelerometer.Initialize();

            somaAd              = new SomaAd();
            somaAd.Adspace      = 923881181;
            somaAd.Pub          = 923881181;
            somaAd.AdSpaceWidth = 80;
            somaAd.AdSpaceWidth = 480;
            somaAd.GetAd();
        }
예제 #3
0
 public AdManager(SomaAd ad)
 {
     Ad = ad;
     ad.NewAdAvailable += new SomaAd.OnNewAdAvailable(ad_NewAdAvailable);
     ad.GetAd();
 }