本文整理汇总了C#中Village.LoadContent方法的典型用法代码示例。如果您正苦于以下问题:C# Village.LoadContent方法的具体用法?C# Village.LoadContent怎么用?C# Village.LoadContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Village
的用法示例。
在下文中一共展示了Village.LoadContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
public override void LoadContent()
{
if (_content == null)
_content = new ContentManager(ScreenManager.Game.Services, "Content");
//_gameFont = _content.Load<SpriteFont>(@"Fonts\gamefont");
_gameSound = _content.Load<Song>(@"SFX\gameSound");
MediaPlayer.IsRepeating = true;
MediaPlayer.Volume = Settings.MainVolume;
MediaPlayer.Play(_gameSound);
_CreateWorld();
World.Selection.LoadContent(_content);
MapObjectLayer objects = World.Map.GetLayer("Objects") as MapObjectLayer;
if (objects != null) {
MapObject headQuarterLocation = objects.GetObject("HQ");
World.HeadQuarter = new HeadQuarter(new Vector2(headQuarterLocation.Bounds.X, headQuarterLocation.Bounds.Y),
@"Textures\Buildings\HQ", 300, 500, 999, 500, 999);
World.HeadQuarter.LoadContent(_content);
World.ResourcesManager = new ResourcesManager(World.HeadQuarter);
World.ResourcesManager.LoadContent(_content);
foreach (MapObject obj in objects.GetObjectsByType("Village"))
{
int initFood = Convert.ToInt32(obj.Properties["Food"].RawValue);
int initMedicine = Convert.ToInt32(obj.Properties["Medicine"].RawValue);
int initPopulation = Convert.ToInt32(obj.Properties["Population"].RawValue);
Village village = new Village(new Vector2(obj.Bounds.X, obj.Bounds.Y), initFood, 999, initMedicine, 999, initPopulation);
village.LoadContent(_content);
World.Sprites.Add(village);
}
World.Sprites.Add(World.HeadQuarter);
}
World.Camera.Focus(World.HeadQuarter.Position);
World.LoadCollisionClip();
World.Time = new WorldTime(12, 10, 2012, 6, 0);
// once the load has finished, we use ResetElapsedTime to tell the game's
// timing mechanism that we have just finished a very long frame, and that
// it should not try to catch up.
ScreenManager.Game.ResetElapsedTime();
}