protected override void BeginTransitionOn()
        {
            spriteBatch = new SpriteBatch(device);
            font = content.Load<SpriteFont>("Consolas");

            scene = new Scene(kernel);

            var camera = new EntityDescription(kernel);
            camera.AddProperty(new TypedName<Camera>("camera"));
            camera.AddProperty(new TypedName<Viewport>("viewport"));
            camera.AddBehaviour<View>();
            var cameraEntity = camera.Create();
            cameraEntity.GetProperty(new TypedName<Camera>("camera")).Value = new Camera();
            cameraEntity.GetProperty(new TypedName<Viewport>("viewport")).Value = new Viewport() { Height = 1920, Width = 1080 };
            scene.Add(camera.Create());

            var renderer = scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<A>()
                .Then<B>()
                .Then<C>()
                .Then<D>()
                .Apply();

            base.OnShown();
        }
Exemple #2
0
        public override void OnShown()
        {
            spriteBatch = new SpriteBatch(device);
            font        = content.Load <SpriteFont>("Consolas");

            scene = new Scene(kernel);

            var camera = new EntityDescription(kernel);

            camera.AddProperty <Camera>("camera");
            camera.AddProperty <Viewport>("viewport");
            camera.AddBehaviour <View>();
            var cameraEntity = camera.Create();

            cameraEntity.GetProperty <Camera>("camera").Value     = new Camera();
            cameraEntity.GetProperty <Viewport>("viewport").Value = new Viewport()
            {
                Height = 1920, Width = 1080
            };
            scene.Add(camera.Create());

            var renderer = scene.GetService <Renderer>();

            renderer.StartPlan()
            .Then <A>()
            .Then <B>()
            .Then <C>()
            .Then <D>()
            .Apply();

            base.OnShown();
        }
Exemple #3
0
        public override void OnShown()
        {
            scene = new Scene(kernel);

            var camera = new EntityDescription(kernel);

            camera.AddProperty <Camera>("camera");
            camera.AddProperty <Viewport>("viewport");
            camera.AddBehaviour <View>();
            var cameraEntity = camera.Create();

            cameraEntity.GetProperty <Camera>("camera").Value     = new Camera();
            cameraEntity.GetProperty <Viewport>("viewport").Value = new Viewport()
            {
                Width = 1280, Height = 720
            };
            scene.Add(camera.Create());

            var renderer = scene.GetService <Renderer>();

            renderer.StartPlan()
            .Then(new ClearPhase()
            {
                Colour = Color.Black
            })
            .Then(new Phase(device)
            {
                Font = content.Load <SpriteFont>("Consolas")
            })
            .Apply();

            base.OnShown();
        }
Exemple #4
0
        protected override void BeginTransitionOn()
        {
            _scene = new Scene(_kernel);

            var camera = new EntityDescription(_kernel);
            camera.AddProperty(new TypedName<Camera>("camera"));
            camera.AddProperty(new TypedName<Viewport>("viewport"));
            camera.AddBehaviour<View>();
            var cameraEntity = camera.Create();
            cameraEntity.GetProperty(new TypedName<Camera>("camera")).Value = new Camera();
            cameraEntity.GetProperty(new TypedName<Viewport>("viewport")).Value = new Viewport() { Width = 1280, Height = 720 };
            _scene.Add(cameraEntity);

            var renderer = _scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then(new Phase(_device) { Font = _content.Load<SpriteFont>("Consolas") })
                .Then(new ClearPhase() { Colour = Color.Black })
                .Apply();

            base.OnShown();
        }
Exemple #5
0
        public override void OnShown()
        {
            scene = new Scene(kernel);

            var camera = new EntityDescription(kernel);
            camera.AddProperty<Camera>("camera");
            camera.AddProperty<Viewport>("viewport");
            camera.AddBehaviour<View>();
            var cameraEntity = camera.Create();
            cameraEntity.GetProperty<Camera>("camera").Value = new Camera();
            cameraEntity.GetProperty<Viewport>("viewport").Value = new Viewport() { Width = 1280, Height = 720 };
            scene.Add(camera.Create());

            var renderer = scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then(new ClearPhase() { Colour = Color.Black })
                .Then(new Phase(device) { Font = content.Load<SpriteFont>("Consolas") })
                .Apply();

            base.OnShown();
        }