public override void Draw(GameTime time, Renderer renderer)
        {
            base.Draw(time, renderer);

            //LIGHT PASS
            var lightMapPass = renderer.ApplyPass(RenderType.DarknessMask, Color.Black);
            DrawCelestialsOrdered(time, lightMapPass);

            //MAIN PASS
            var resultPass = renderer.ApplyPass(RenderType.Final, Color.Black);

            _background.Render(time, resultPass);

            DrawCelestialsOrdered(time, resultPass);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.Draw(_descriptionPanel, new Vector2(963, 356), new Vector2(586, 672));
                sbh.Draw(_scientistPhoto, new Vector2(350, 360), new Vector2(486, 600));
                sbh.DrawString(_fontBig, YND.Speech[_speechKeyTitle].Text, new Vector2(963, 100), 520, Color.White);

                sbh.DrawString(_fontSmall, YND.Speech[_speechKey].Text, new Vector2(963, 386), 520, Color.White);
            }

            _backButton.Render(time, resultPass);
        }
        public override void Draw(GameTime time, Renderer renderer)
        {
            base.Draw(time, renderer);

            //LIGHT PASS
            var lightMapPass = renderer.ApplyPass(RenderType.DarknessMask, Color.Black);
            DrawCelestialsOrdered(time, lightMapPass);

            //MAIN PASS
            var resultPass = renderer.ApplyPass(RenderType.Final, Color.Black);

            _background.Render(time, resultPass);
            foreach (var system in _nebulas) system.Render(time, resultPass);
            DrawCelestialsOrdered(time, resultPass);

            if (!freeTransformMode)
            {
                using (var sbh = new SpriteBatchHelper())
                {
                    sbh.DrawString(_fontSmall, "Join your hands to explore.", new Vector2(350, 50), 0, Color.White);

                    sbh.Draw(_descriptionPanel, new Vector2(963, 356), new Vector2(586, 672));
                    sbh.DrawString(_fontBig, YND.Speech[_speechKeyTitle].Text, new Vector2(940, 80), 520, Color.White);
                    sbh.DrawString(_fontSmall, YND.Speech[_speechKey].Text, new Vector2(963, 356), 520, Color.White);
                }
            }

            _backButton.Render(time, resultPass);
        }
        public override void DrawFrame(GameTime time, RendererPass resultPass)
        {
            _background.Render(time, resultPass);

            using (var sbh = new SpriteBatchHelper(SpriteSortMode.Deferred, BlendState.AlphaBlend))
            {
                sbh.DrawStringOutlined(_font, YND.Speech[SpeechKey.ScaleInfo].Text, new Vector2(640, 60), 1200, Color.White, Color.Black, 2, 1);

                for (int i = 0; i < 31; i++)
                {
                    float distance = 640 * (i * 2) - displayOffset;
                    if (Math.Abs(distance) > 1000)
                        continue;

                    float scale = (distance / 1000.0f) + 1;
                    //if (scale < 0) continue;
                    sbh.Draw(pictures[i], new Vector2(640, 360), new Vector2(850, 470), Color.Lerp(Color.Transparent, Color.White, 1 - Math.Abs(scale - 1)), 0, MathHelper.Clamp(scale, 0, 5), true);
                }
            }

            //using (var sbh = new SpriteBatchHelper())
            //{
            //    sbh.DrawStringOutlined(_font, YND.Speech[SpeechKey.ScaleInfo].Text, new Vector2(640, 60), 1200, Color.White, Color.Black, 2, 1);
            //    for (int i = 0; i < 31; i++) sbh.Draw(pictures[i], new Vector2(640 * (i * 2 + 1) - displayOffset, 360), new Vector2(850, 470), Color.White);
            //}

            _backButton.Render(time, resultPass);
        }
        public override void Draw(GameTime time, Renderer renderer)
        {
            base.Draw(time, renderer);

            //LIGHT PASS
            var lightMapPass = renderer.ApplyPass(RenderType.DarknessMask, Color.Black);

            DrawCelestialsOrdered(time, lightMapPass);

            //MAIN PASS
            var resultPass = renderer.ApplyPass(RenderType.Final, Color.Black);

            _background.Render(time, resultPass);
            DrawCelestialsOrdered(time, resultPass);

            _backButton.Render(time, resultPass);

            using (var sbh = new SpriteBatchHelper())
            {
                String txt = "External resources used in project:";
                txt += "\n\nTextures:\n\tNASA, ESA, and the Hubble SM4 ERO Team \n\tUsed NASA materials are in the public domain\n\tand are not copyrighted.";
                txt += "\n\nFont:\n\t\"Orbitron\" available under OFL licence.";
                txt += "\n\nMusic:\n\tQuiet Noise (Soft String mix) by Brendan J. Boyd\n\tAvailable under CC BY-NC-SA 3.0 licence.";
                txt += "\n\nArticles:\n\tParts of wikipedia articles.\n\tAvailable under CC BY SA 3.0 licence.";
                txt += "\n\nLibraries:\n\tKinect Toolbox\n\tAvailable under Microsoft Public License.";

                sbh.DrawStringOutlined(_fontSmall, txt, new Vector2(930, 300), 0, new Color(30, 30, 50, 255), Color.White);
            }
        }
Ejemplo n.º 5
0
        public override void Draw(GameTime time, Renderer renderer)
        {
            base.Draw(time, renderer);

            //LIGHT PASS
            var lightMapPass = renderer.ApplyPass(RenderType.DarknessMask, Color.Black);

            PrepareCeletialsForDrawing();
            DrawPlanetsOrdered(time, lightMapPass);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.DrawString(_fontBig, "Episodes", new Vector2(640, 360), 0, new Color(30, 30, 50, 255));
            }

            DrawStarsOrdered(time, lightMapPass);

            //MAIN PASS
            var resultPass = renderer.ApplyPass(RenderType.Final, Color.Black);

            _background.Render(time, resultPass);
            DrawCelestialsOrdered(time, resultPass);

            _backButton.Render(time, resultPass);
            _buttons.Each((b) => b.Render(time, resultPass));

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.DrawStringOutlined(_fontBig, "Episodes", new Vector2(640, 360), 0, new Color(30, 30, 50, 255), Color.White, 2);
            }
        }
Ejemplo n.º 6
0
 public void Render(GameTime time, RendererPass rendererPass)
 {
     using (var sbh = new SpriteBatchHelper())
     {
         Vector2 position = new Vector2(YND.GraphicsDevice.Viewport.Width, YND.GraphicsDevice.Viewport.Height) * YND.SensorMouse.RightHandPosition;
         sbh.Draw(_texture, position, Vector2.One * _size, Color.Lime, _rotation, 1, true);
     }
 }
Ejemplo n.º 7
0
 public void Render(GameTime time, RendererPass rendererPass)
 {
     using (var sbh = new SpriteBatchHelper())
     {
         sbh.Draw(_texture, _position, Vector2.One * _size, Color.White, _rotation);
         sbh.DrawStringOutlined(_font, _caption, _position, 0, Color.White, Color.Black, 2);
     }
 }
Ejemplo n.º 8
0
        public override void DrawFrame(GameTime time, RendererPass resultPass)
        {
            _background.Render(time, resultPass);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.DrawStringOutlined(_font, YND.Speech[voices[currentSlot]].Text, new Vector2(640, 60), 1200, Color.White, Color.Black, 2, 1);
                for (int i = 0; i < 5; i++) sbh.Draw(pictures[i], new Vector2(640 * (i * 2 + 1) - displayOffset, 360), new Vector2(756, 471), Color.White);
            }
        }
Ejemplo n.º 9
0
        public void MoveToScreen(RenderType type, bool realFullScreen = false)
        {
            YND.GraphicsDevice.SetRenderTarget(null);
            YND.GraphicsDevice.Clear(Color.Black);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.DrawFullScreen(_passes[type].RenderTarget, realFullScreen);
            }
        }
Ejemplo n.º 10
0
        public override void DrawFrame(GameTime time, RendererPass resultPass)
        {
            _background.Render(time, resultPass);

            Color color = Color.White;
            if (fadeTime < 2) color = Color.Lerp(Color.Transparent, Color.White, fadeTime / 2.0f);
            if (fadeTime > 6) color = Color.Lerp(Color.White, Color.Transparent, (fadeTime - 6) / 2.0f);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.Draw(_logo, new Vector2(640, 360), new Vector2(756, 471), color);
            }
        }
        public override void Draw(GameTime time, Renderer renderer)
        {
            _frames[_currentFrame].Stage.Draw(time, renderer);

            _backButton.Render(time,renderer.CurrentPass);

            if (_frames[_currentFrame].Narration != null)
            {
                using (var sbh = new SpriteBatchHelper())
                {
                    sbh.DrawStringOutlined(_font, YND.Speech[_frames[_currentFrame].Narration.Value].Text, new Vector2(640, 650), 1200, Color.White, Color.Black, 2, 1);
                }
            }
        }
Ejemplo n.º 12
0
        public override void Draw(GameTime time, Renderer renderer)
        {
            base.Draw(time, renderer);

            //LIGHT PASS
            var lightMapPass = renderer.ApplyPass(RenderType.DarknessMask, Color.Black);

            DrawCelestialsOrdered(time, lightMapPass);

            //MAIN PASS
            var resultPass = renderer.ApplyPass(RenderType.Final, Color.Black);

            _background.Render(time, resultPass);
            DrawCelestialsOrdered(time, resultPass);

            _backButton.Render(time, resultPass);
            _externalButton.Render(time,resultPass);

            using (var sbh = new SpriteBatchHelper())
            {
                sbh.DrawStringOutlined(_fontBig, "        Imagine Cup 2013\n\n\nYellow Noodle Dog Team:\n      Bartosz Jankowski\n        Tomasz Gieniusz", new Vector2(930, 200), 0, new Color(30,30,50, 255), Color.White);
            }
        }
Ejemplo n.º 13
0
        public void Render(GameTime time, RendererPass rendererPass)
        {
            //curr = Keyboard.GetState();
            //if (curr.IsKeyDown(Keys.Space) && prev.IsKeyUp(Keys.Space)) showStarObject = !showStarObject;
            //prev = curr;

            CalculateWorldMatrix();

            if (rendererPass.RenderType == RenderType.DarknessMask)
            {
                model.Render(_worldMatrix, new TextureShaderParameters());
                CopyToDedicatedOffscreen(rendererPass);
                RemoveFromLightMask(rendererPass);
            }
            else
            {
                using (var sbh = new SpriteBatchHelper(0, BlendState.Additive))
                {
                    sbh.DrawFullScreen(_postProcessTarget);
                }

                if (ShowStarObject) model.Render(_worldMatrix, new TextureShaderParameters());
            }
        }
Ejemplo n.º 14
0
        private void CopyToDedicatedOffscreen(RendererPass rendererPass)
        {
            var starPositionScreen = YND.GraphicsDevice.Viewport.Project(Position, Camera.Instance.ProjectionMatrix, Camera.Instance.ViewMatrix, Matrix.Identity);
            var viewportSize = new Vector2(YND.GraphicsDevice.Viewport.Width, YND.GraphicsDevice.Viewport.Height);

            YND.GraphicsDevice.SetRenderTarget(_postProcessTarget);

            _postProcess.Parameters["ScreenLightPos"].SetValue(new Vector2(starPositionScreen.X / viewportSize.X, starPositionScreen.Y / viewportSize.Y));
            _postProcess.Parameters["Density"].SetValue(_density);
            _postProcess.Parameters["Weight"].SetValue(_weight);
            _postProcess.Parameters["Decay"].SetValue(_decay);
            _postProcess.Parameters["Steps"].SetValue(_steps);

            using (var sbh = new SpriteBatchHelper(_postProcess, "MatrixTransform"))
            {
                sbh.DrawFullScreen(rendererPass.RenderTarget);
            }
        }