我按照 Microsoft 的文档将 Microsoft 广告包含在我的混合游戏中。一切正常,但“测试广告”不可见!但是,如果我点击它应该在的位置,它会打开 bing。这是我的画:
private void OnDraw(object sender, GameTimerEventArgs e)
{
SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
background.Draw(spriteBatch);
// Draw the Enemies
for (int i = 0; i < Plattforms.Count; i++)
{
Plattforms[i].Draw(spriteBatch);
}
powerbar.DrawPower(spriteBatch);
player.Draw(spriteBatch);
particleComponent.Draw(spriteBatch);
particleComponentfinal.Draw(spriteBatch);
spriteBatch.DrawString(font, level.score.ToString(), new Vector2(20, 20), Color.White);
if (bg.donebook == true) { spriteBatch.Draw(bg.done, new Vector2(0, 0), Color.White); }
if (countdown == true) { spriteBatch.DrawString(countfont, countdowntime.ToString(), new Vector2(360, 200), Color.White); }
// draw the ad control
AdComponent.Current.Draw();
spriteBatch.End();
}