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


C# ScreenContext类代码示例

本文整理汇总了C#中ScreenContext的典型用法代码示例。如果您正苦于以下问题:C# ScreenContext类的具体用法?C# ScreenContext怎么用?C# ScreenContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ScreenContext类属于命名空间,在下文中一共展示了ScreenContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // Load storage game data
            GameStorage gameStorage;
            if (WaveServices.Storage.Exists<GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read<GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            // Register the SoundManager service
            WaveServices.RegisterService<SoundManager>(new SoundManager());

            WaveServices.ViewportManager.Activate(768, 1280, ViewportManager.StretchMode.Uniform);

            var gameContext = new ScreenContext("GamePlayContext", new GamePlayScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground
            };
            var introContext = new ScreenContext(new IntroScene());
            WaveServices.ScreenContextManager.Push(gameContext);
            WaveServices.ScreenContextManager.Push(introContext);

            // Play background music
            WaveServices.MusicPlayer.Play(new MusicInfo("Content/music.mp3"));
            WaveServices.MusicPlayer.Volume = 0.3f;
            WaveServices.MusicPlayer.IsRepeat = true;
        }
开发者ID:dezol,项目名称:QuickStarters,代码行数:35,代码来源:Game.cs

示例2: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            GameStorage gameStorage;
            if (WaveServices.Storage.Exists<GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read<GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            application.Adapter.DefaultOrientation = DisplayOrientation.Portrait;
            application.Adapter.SupportedOrientations = DisplayOrientation.Portrait;

            ScreenContext screenContext = new ScreenContext(new MainMenuScene());

            // Play background music
            WaveServices.MusicPlayer.Play(new MusicInfo(WaveContent.Assets.Sounds.bg_music_mp3));
            WaveServices.MusicPlayer.IsRepeat = true;

            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:WaveEngine,项目名称:QuickStarters,代码行数:27,代码来源:Game.cs

示例3: CreateScene

        protected override void CreateScene()
        {
            RenderManager.BackgroundColor = Color.FloralWhite;

            Button startGameButton = new Button()
            {
                HorizontalAlignment = WaveEngine.Framework.UI.HorizontalAlignment.Center,
                VerticalAlignment = WaveEngine.Framework.UI.VerticalAlignment.Center,
                Text = string.Empty,
                IsBorder = false,
                BackgroundImage = Textures.PLAY_BUTTON,
                PressedBackgroundImage = Textures.PLAY_BUTTON_PRESSED
            };
            startGameButton.Click += (o, e) =>
            {
                TimeSpan timeSpan = new TimeSpan(0, 0, 0, 1, 500);
                CurtainsTransition transition = new CurtainsTransition(timeSpan);
                ScreenContext gameContext = new ScreenContext("GameScene", new GameScene())
                {
                    Behavior = ScreenContextBehaviors.DrawInBackground //Hacemos que se renderize cuando esté apilado en background (Paused)
                };
                WaveServices.ScreenContextManager.Push(gameContext, transition);
            };

            EntityManager.Add(startGameButton);
        }
开发者ID:JJBocanegra,项目名称:DinoEscape,代码行数:26,代码来源:MenuScene.cs

示例4: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            GameStorage gameStorage;
            if (WaveServices.Storage.Exists<GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read<GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            application.Adapter.DefaultOrientation = DisplayOrientation.Portrait;
            application.Adapter.SupportedOrientations = DisplayOrientation.Portrait;

            //ViewportManager vm = WaveServices.ViewportManager;
            //vm.Activate(768, 1024, ViewportManager.StretchMode.Fill);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:kevins963,项目名称:ColorDrop,代码行数:25,代码来源:Game.cs

示例5: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // Load storage game data
            GameStorage gameStorage;

            if (WaveServices.Storage.Exists<GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read<GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem<GameStorage>(gameStorage);

            // Register the SoundManager service
            WaveServices.RegisterService<SoundManager>(new SoundManager());

            // Play background music
            WaveServices.MusicPlayer.Play(new MusicInfo(WaveContent.Assets.Audio.bg_music_mp3));
            WaveServices.MusicPlayer.IsRepeat = true;

            // GameBackContext is visible always at the background.
            // For this reason the behavior is set to Draw and Update when the scene is in background.
            var backContext = new ScreenContext("GameBackContext", new GameScene());
            backContext.Behavior = ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground;

            //On init show the Main menu
            WaveServices.ScreenContextManager.Push(backContext);
            WaveServices.ScreenContextManager.Push(new ScreenContext("MenuContext", new MenuScene()));
        }
开发者ID:WaveEngine,项目名称:QuickStarters,代码行数:34,代码来源:Game.cs

示例6: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ScreenContext screenContext = new ScreenContext(new StockScene(WaveContent.Scenes.EmitterScene));
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:julietsvq,项目名称:Samples,代码行数:7,代码来源:Game.cs

示例7: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:123asd123A,项目名称:Samples,代码行数:7,代码来源:Game.cs

示例8: Initialize

 public override void Initialize(IApplication application)
 {
     base.Initialize(application);
     ViewportManager vm = WaveServices.ViewportManager;
     vm.Activate(1280, 720, ViewportManager.StretchMode.Uniform);
     ScreenContext screenContext = new ScreenContext(new MainMenuScene());
     WaveServices.ScreenContextManager.To(screenContext);
 }
开发者ID:juliansorel,项目名称:halloween,代码行数:8,代码来源:Game.cs

示例9: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            WaveServices.ViewportManager.Activate(800, 600, ViewportManager.StretchMode.Uniform);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:seraph526,项目名称:Samples,代码行数:9,代码来源:Game.cs

示例10: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // Use ViewportManager to ensure scaling in all devices
            WaveServices.ViewportManager.Activate(1024, 576, ViewportManager.StretchMode.Uniform);

            ScreenContext screenContext = new ScreenContext(new BackgroundScene(), new MainScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:rkierkels,项目名称:Samples,代码行数:10,代码来源:Game.cs

示例11: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ViewportManager vm = WaveServices.GetService<ViewportManager>();
            vm.Activate(800, 480, ViewportManager.StretchMode.Fill);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:123asd123A,项目名称:Samples,代码行数:10,代码来源:Game.cs

示例12: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);

            string liscenseKey = "Afv3YtH/////AAAAAd6O5swHskO5iA9kEPTrLhUfL0+AXF0Kmbc37H865djR8OyOWZxNgHLluSS1NML85StoInIgPw/UPEmcMfjV6KNwSn/enTSseboJxd8zrYfPY8v4iuhuZlyJ7K918/xnwDUS17Qx3o/6Fx2eVqU4puzoZNsLoMhpFTZbBgrpbZ5aCsLhz0jxsVZO729c6EXPZvMgLDaseU3DRgbSbk4cnn8LiQNhpeYVo5sxl3eqZKnu4HyDLhdCuGdtKEOChFKQShd7QcXnlxijV7+q6j1yI8GP8H75YFg5kYXf5nDquvbOGX7tXU17E/x62mRW+U0rJJ9ZYCQ857eo+PPKL4ZsEpAvGURGYpeSxtFgH0L8uyQ0";
            WaveServices.RegisterService(new VuforiaService(WaveContent.Assets.AR.TestVuforia_xml, liscenseKey));
        }
开发者ID:julietsvq,项目名称:Samples,代码行数:10,代码来源:Game.cs

示例13: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            LeapMotionService leapMotionService = new LeapMotionService();
            WaveServices.RegisterService(leapMotionService);
            leapMotionService.StartSensor(LeapFeatures.Hands | LeapFeatures.CameraImages);

            ScreenContext screenContext = new ScreenContext(new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:julietsvq,项目名称:Samples,代码行数:11,代码来源:Game.cs

示例14: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            WaveServices.RegisterService(new ScoreService());
            WaveServices.RegisterService(new AnimationService());
            WaveServices.RegisterService(new AudioService());

            ScreenContext screenContext = new ScreenContext(new InitialScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:WaveEngine,项目名称:QuickStarters,代码行数:11,代码来源:Game.cs

示例15: Initialize

        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // ViewportManager is used to automatically adapt resolution to fit screen size
            ViewportManager vm = WaveServices.ViewportManager;
            vm.Activate(1280, 720, ViewportManager.StretchMode.Uniform);

            ScreenContext screenContext = new ScreenContext(new Arena());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:Lucrecious,项目名称:Battle-Team,代码行数:11,代码来源:Game.cs


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