当前位置: 首页>>代码示例>>C#>>正文


C# Scene.LoadContent方法代码示例

本文整理汇总了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);
        }
开发者ID:cmark89,项目名称:InaneSubterra,代码行数:10,代码来源:InaneSubterra.cs

示例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
        }
开发者ID:EricPolman,项目名称:clockwork-age,代码行数:14,代码来源:Game1.cs

示例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();
        }
开发者ID:willcraftia,项目名称:WindowsGame,代码行数:70,代码来源:Test1Screen.cs

示例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();
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:32,代码来源:RPGScreen.cs


注:本文中的Scene.LoadContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。