本文整理汇总了C#中Basket.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Basket.Initialize方法的具体用法?C# Basket.Initialize怎么用?C# Basket.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Basket
的用法示例。
在下文中一共展示了Basket.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
Sources = new List<Source>();
//set the display to all orientations, then set the size of the screen, then FORCE potrait mode.
//this makes it full screen portrait. There is most definitely a better way, but I do not know it.
graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
graphics.SupportedOrientations = DisplayOrientation.Portrait;
StartTime = new TimeSpan(0, 0, 0);//initialize start time to something...it will change for sure
//Add some ads to the app!
//CURRENTLY THERE ARE NO ADS
/*
AdManager ads = new AdManager(this);
AdGameComponent.Initialize(this, ads.ApplicationId);
Components.Add(AdGameComponent.Current);
ads.CreateAd();
*/
//get the old highscore
highScore = loadHiScore();
//create all the buttons we need. Chances are the Y values of these may end up changing
//pass in the image representing the text the button should display
StartButton = new Button(this,"play_game", 300);
MainMenuButton = new Button(this, "home", 600);
ResetButton = new Button(this, "Reset", 475);
InstructionsButton = new Button(this, "Instructions", 400);
TimeLeft = TimeSpan.FromSeconds(30);//as of now games will start off lasting 30 seconds
mIsTitleScreenShown = true;//start off with titlescreen shown
basket = new Basket(this);
basket.Initialize();
//setup the fonts
SmallFont = Content.Load<SpriteFont>("InGameFont");
LargeFont = Content.Load<SpriteFont>("HiScoreFont");
graphics.ApplyChanges();
OldState = Keyboard.GetState();//get initial state of keyboard
base.Initialize();
}