XNA AdGameComponent does not draw
- by Alex Shkor
I have following code.
But AddGameComponent doesn't draw.
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
var li = new LicenseInformation();
IsTrial = li.IsTrial();
if (IsTrial)
{
AdGameComponent.Initialize(this, AppID);
Components.Add(AdGameComponent.Current);
CreateAd();
}
}
private void CreateAd()
{
bannerAd = AdGameComponent.Current.CreateAd(AdUnitID, new Rectangle(x, y, width, height), true);
AdGameComponent.Current.Enabled = true;
}
I have tried to set DrawOrder to 1000, but ads still doesn't work.