• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ScreenContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Initialize

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

            // Creates a ScreenContext with two scenes.
            //  + The first one will be rendered in a RenderTarget.
            //  + The second one is the primary scene.
            // The RenderTargetScene must be the added before the primary scene.
            ScreenContext screenContext = new ScreenContext(new RenderTargetScene(), new MyScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:nagyistoce,项目名称:WaveEngine-Samples,代码行数:11,代码来源:Game.cs


示例17: Initialize

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

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

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

            ScreenContext screenContext = new ScreenContext(new MenuScene());
            WaveServices.ScreenContextManager.To(screenContext);
        }
开发者ID:pablovargan,项目名称:tyriongame-wave,代码行数:12,代码来源:Game.cs


示例18: Initialize

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

            // Register KinectServices
            var kinectService = new KinectService();
            WaveServices.RegisterService(kinectService);
            kinectService.StartSensor(KinectSources.Color | KinectSources.Body);//| KinectSources.Face);

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


示例19: Initialize

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

            #if WINDOWS
            //Register oculus rift service
            WaveServices.RegisterService<WaveEngine.OculusRift.OVRService>(new WaveEngine.OculusRift.OVRService(application));
            #endif
            WaveServices.RegisterService<HeadTrackSensor>(new HeadTrackSensor());

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


示例20: Initialize

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

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

#if ANDROID
            InitializeAndRegisterSocialService();
#endif

            // 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());

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

            var backContext = new ScreenContext("BackContext", new BackgroundScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground
            };

            var mainContext = new ScreenContext(new MainMenuScene());


            WaveServices.ScreenContextManager.Push(backContext);
            WaveServices.ScreenContextManager.Push(mainContext);

            // Play music
            WaveServices.MusicPlayer.Play(new MusicInfo(WaveContent.Assets.Sounds.bg_music_mp3));
            WaveServices.MusicPlayer.Volume = 1.0f;
            WaveServices.MusicPlayer.IsRepeat = true;
        }
开发者ID:DeveloperSkeletor,项目名称:QuickStarters,代码行数:47,代码来源:Game.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ScreenManager类代码示例发布时间:2022-05-24
下一篇:
C# Screen类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap