本文整理汇总了C#中Scene.LoadContent方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.LoadContent方法的具体用法?C# Scene.LoadContent怎么用?C# Scene.LoadContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.LoadContent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetScene
public static void SetScene(Scene newScene)
{
if (currentScene != null)
currentScene.Unload();
currentScene = newScene;
newScene.Initialize();
newScene.LoadContent(StaticContent);
}
示例2: LoadContent
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
SCREEN_RECT = new Rectangle(graphics.GraphicsDevice.Viewport.X, graphics.GraphicsDevice.Viewport.Y, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);
spriteBatch = new SpriteBatch(GraphicsDevice);
mainScene = new Scene(this,"testscene");
mainScene.LoadContent(Content, GraphicsDevice);
// TODO: use this.Content to load your game content here
}
示例3: LoadContent
public override void LoadContent()
{
base.LoadContent();
scene = new Scene(sceneContext, "Scenes/Test1Scene");
sceneRenderer = new SceneRenderer(scene);
#region Start-up mediators
#region CameraMeditor [free]
{
var mediator = new CameraMediator();
mediator.CameraName = "free";
mediator.MoveVelocity = 30.0f;
scene.StartupMediators.Add(mediator);
}
#endregion
#region CameraMediator [satellite]
{
var mediator = new CameraMediator();
mediator.CameraName = "satellite";
mediator.MoveVelocity = 60.0f;
scene.StartupMediators.Add(mediator);
}
#endregion
#region CubeCharacterCameraMediator [char/Player]
{
var mediator = new CubeCharacterCameraMediator();
mediator.CameraName = "char";
mediator.CharacterActorName = "Player";
mediator.DashVelocity = 20.0f;
scene.StartupMediators.Add(mediator);
}
#endregion
#region WorldTimeMediator
{
var mediator = new WorldTimeMediator();
scene.StartupMediators.Add(mediator);
}
#endregion
#region SunLightMediator
{
var mediator = new SunLightMediator();
scene.StartupMediators.Add(mediator);
}
#endregion
#endregion
#region Player
scene.Player.ControllingPlayer = ControllingPlayer.Value;
#endregion
scene.LoadContent();
sceneRenderer.LoadContent();
LoadDebugContent();
// 読み込みが完了したら、ResetElapsedTime() を使用して、非常に長い
// フレームを完了したことと、キャッチアップしようとする必要がないことを、
// ゲームのタイミング メカニズムに指示します。
ScreenContext.ResetElapsedTime();
}
示例4: LoadContent
/// <summary>
/// Load graphics content for the game.
/// </summary>
public override void LoadContent()
{
if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); }
#region Initialize
//Store the device.
device = ScreenManager.GraphicsDevice;
ScreenManager.Game.IsMouseVisible = false;
Mouse.WindowHandle = ScreenManager.Game.Window.Handle;
//Create the scene.
_Scene = new SmallDemoScene();
//Create the camera.
_Camera = new Camera2D(new Rectangle(0, 0, ScreenManager.Game.Window.ClientBounds.Width, ScreenManager.Game.Window.ClientBounds.Height),
new Rectangle(0, 0, 2000, 2000));
_Camera.Position = new Vector2(1000, 1000);
#endregion
#region LoadContent
//Load content.
_Scene.LoadContent(ScreenManager.GraphicsDevice, content);
#endregion
// 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();
}