Question

I am inserting advertising on a windows phone 7 app. this is where i create the drawable add:

AdComponent.Initialize("test_client");
Microsoft.Xna.Framework.Rectangle rect = new Microsoft.Xna.Framework.Rectangle(0, 0, 480, 80);
//rect.Location= (20,20);
drawableAd = AdComponent.Current.CreateAd("Image480_80", rect, true);
drawableAd.AdRefreshed += new EventHandler(drawableAd_AdRefreshed);
drawableAd.ErrorOccurred += new EventHandler<Microsoft.Advertising.AdErrorEventArgs>(drawableAd_ErrorOccurred);

and this is where i draw it on the OnDraw method:

AdComponent.Current.Draw(); 

what i am trying to do is make it come to the front, because i draw other components on the OnDraw method and even though i draw the add in the end, it still goes behind all the other components

Was it helpful?

Solution

i figured it out, i was drawing it inside the spriteBatch together with the other components when in fact you have to draw it after the spriteBatch.End(); thanks for the help anyway

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top