Draw() 공개 메소드

Draw the specified parent.
public Draw ( ) : void
리턴 void
예제 #1
0
        public override void DrawUI()
        {
            base.DrawUI();

            _returnLabel.Draw();

            if (_state != MapState.ReturnToNexusLabel)
            {
                _yesLabel.Draw();
                _noLabel.Draw();
            }

            Minimap minimap = GlobalState.CurrentMinimap;

            if (minimap.tiles.Width == 0)
            {
                _noMapLabel.Draw();
            }

            //explicit int math to not have to deal with subpixels
            int x = 110 - minimap.tiles.Width * _mapSheet.Width / 2;
            int y = 70 - minimap.tiles.Height * _mapSheet.Height / 2;

            minimap.Draw(_mapSheet, new Vector2(x, y), DrawPlayerIndicator: _playerIndicatorTimer < _playerBlink);

            selector.Draw();
        }
예제 #2
0
 /// <summary>
 /// Draws on screen.
 /// </summary>
 /// <param name="spriteBatch"></param>
 public static void DrawUi(SpriteBatch spriteBatch)
 {
     _minimap.Draw(spriteBatch);
     _inventory.Draw(spriteBatch);
     ButtonBar.Draw(spriteBatch);
     HotBar.Draw(spriteBatch);
     _inventory.DrawOnTop(spriteBatch);
 }
예제 #3
0
        public override void Draw(GameTime GameTime)
        {
            base.Draw(GameTime);

            spriteList.ForEach((x) => x.Draw(GameTime, spriteBatch));
            minimap.Draw(GameTime, spriteBatch);
            lock (playerButtonList) playerButtonList.Draw(GameTime, spriteBatch);
            matchConfigurationGrid.Draw(GameTime, spriteBatch);

            //ServerInformationHandler.ClientReadyToStartGame();
        }
예제 #4
0
        public void Draw(SpriteBatch sb, GFXHandler gh)
        {
            if (zones[curZoneID] != null)
            {
                zones[curZoneID].Draw(sb);
            }

            if (drawMinimap)
            {
                minimap.Draw(sb, gh);
            }
        }
예제 #5
0
    private void DrawPlayerOnMinimap(Player player)
    {
        var obj = _playersPool.Pop();

        if (obj != null)
        {
            _minimap.Draw(obj, player.Position);
        }


        PlayersDrawedOnMinimap++;
    }
예제 #6
0
 /// <summary>
 /// Draws the scene.
 /// </summary>
 /// <param name="spriteBatch">The spriteBatch.</param>
 /// <param name="gameTime">The GameTime.</param>
 public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
 {
     _skyBox.Draw(spriteBatch, gameTime);
     _entityComposer.Draw(spriteBatch, gameTime);
     if (!_debugDisplay.Visible)
     {
         _scoreBoard.Draw(spriteBatch, gameTime);
     }
     _minimap.Draw(spriteBatch, gameTime);
     _debugDisplay.Draw(spriteBatch, gameTime);
     _blackBlend.Draw(spriteBatch, gameTime);
     UIManager.Draw(spriteBatch, gameTime);
 }
예제 #7
0
        /// <summary>
        /// Dessine les éléments graphiques du contrôleur.
        /// </summary>
        public void Draw(SpriteBatch batch)
        {
            int ts = m_baseControler.MapRdr.UnitSize;
            // Récupère la position de la souris
            Vector2 position = new Vector2(Input.GetMouseState().X, Input.GetMouseState().Y);

            // Dessine le cursor
            batch.Draw(Ressources.Cursor, new Rectangle((int)position.X, (int)position.Y, 32, 32), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, ZLayer.Front);

            if (!IsEnabled)
            {
                m_modeButton.IsVisible = false;
                m_console.Visible      = false;
                m_console.HasFocus     = false;
            }
            else
            {
                m_modeButton.IsVisible = true;
                m_console.Visible      = true;
            }

            // Dessine la case survolée
            var rawpos = GetMousePosUnits();

            rawpos.X -= rawpos.X % 1;
            rawpos.Y -= rawpos.Y % 1;
            var pos = m_baseControler.MapRdr.ToScreenSpace(rawpos);

            batch.Draw(Ressources.HighlightMark, new Rectangle((int)pos.X, (int)pos.Y, ts, ts), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, ZLayer.GUI);


            // Dessine le bandeau supérieur
            batch.Draw(Ressources.DummyTexture, new Rectangle(0, 0, (int)Ressources.ScreenSize.X, 25),
                       null, new Color(0, 0, 0, 200), 0.0f, Vector2.Zero, SpriteEffects.None, ZLayer.GUI + 5 * ZLayer.BackStep);

            // Dessine la minimap
            m_minimap.Position = new Vector2(Ressources.ScreenSize.X - 200, Ressources.ScreenSize.Y - 100);
            m_minimap.Size     = new Vector2(200, 100);
            m_minimap.Z        = ZLayer.GUI + 2 * ZLayer.BackStep;
            m_minimap.Draw(batch);

            // Dessine des infos de debug.
            batch.DrawString(Ressources.Font, "RowId = " + m_rowId + " | CheckpointId = " + m_checkpointId + " | Mouse=" + rawpos.ToString(),
                             new Vector2(150, 0), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, ZLayer.GUI + 4 * ZLayer.BackStep);
        }
예제 #8
0
        /// <summary>
        /// Draw this state to the screen.
        /// </summary>
        public override void Draw()
        {
            fps.IncrementFrames();

            SpriteBatch batch = ServiceManager.Game.Batch;

            ServiceManager.Game.GraphicsDevice.RenderState.DepthBufferEnable = true;

            GraphicOptions.graphics.GraphicsDevice.Clear(GraphicOptions.BackgroundColor);//Must manually clear since we're not using the main Draw()

            batch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.FrontToBack, SaveStateMode.SaveState);
            batch.Draw(sky, ServiceManager.Game.GraphicsDevice.Viewport.TitleSafeArea, Color.White);
            batch.End();

            Scene.Draw(false);

            batch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.FrontToBack, SaveStateMode.SaveState);


            batch.DrawString(ServiceManager.Game.Font,
                             fps.GetFormattedFPS(), Vector2.Zero, Color.White);
            batch.DrawString(ServiceManager.Game.Font,
                             FormatTimeLeft(timeLeft), Vector2.UnitX * 300, Color.White);

            batch.End();

            tips.Draw();
            buffbar.Draw();
            if (mouseCursor != null)
            {
                mouseCursor.Draw();
            }
            hud.Draw();
            cd.Draw();
            Chat.Draw();
            miniMap.Draw(localPlayer.Position);

            Scores.Draw();
            helpOverlay.Draw();
        }
예제 #9
0
 public void Draw(SpriteBatch spriteBatch)
 {
     minimap.Draw(spriteBatch);
 }
예제 #10
0
        public override void DrawScene()
        {
            Effects.TerrainFX.SetSsaoMap(_whiteTex);
            Effects.TerrainFX.SetShadowMap(_sMap.DepthMapSRV);
            Effects.TerrainFX.SetShadowTransform(_shadowTransform);
            _minimap.RenderMinimap(_dirLights);



            var view     = _lightView;
            var proj     = _lightProj;
            var viewProj = view * proj;

            _terrain.Renderer.DrawToShadowMap(ImmediateContext, _sMap, viewProj);

            ImmediateContext.Rasterizer.State = null;

            ImmediateContext.ClearDepthStencilView(DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0);
            ImmediateContext.Rasterizer.SetViewports(Viewport);


            _terrain.Renderer.ComputeSsao(ImmediateContext, _camera, _ssao, DepthStencilView);


            ImmediateContext.OutputMerger.SetTargets(DepthStencilView, RenderTargetView);
            ImmediateContext.Rasterizer.SetViewports(Viewport);

            ImmediateContext.ClearRenderTargetView(RenderTargetView, Color.Silver);

            ImmediateContext.ClearDepthStencilView(DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0);

            if (Util.IsKeyDown(Keys.W))
            {
                ImmediateContext.Rasterizer.State = RenderStates.WireframeRS;
            }

            if (Util.IsKeyDown(Keys.S))
            {
                Effects.TerrainFX.SetSsaoMap(_whiteTex);
            }
            else
            {
                Effects.TerrainFX.SetSsaoMap(_ssao.AmbientSRV);
            }
            if (!Util.IsKeyDown(Keys.A))
            {
                Effects.TerrainFX.SetShadowMap(_sMap.DepthMapSRV);
                Effects.TerrainFX.SetShadowTransform(_shadowTransform);
            }
            else
            {
                Effects.TerrainFX.SetShadowMap(_whiteTex);
            }

            Effects.BasicFX.SetEyePosW(_camera.Position);
            Effects.BasicFX.SetDirLights(_dirLights);
            Effects.BasicFX.SetSsaoMap(_whiteTex);
            Effects.BasicFX.SetSsaoMap(_whiteTex);


            if (_showSphere)
            {
                _sphere.World = Matrix.Translation(_spherePos);
                for (var p = 0; p < Effects.BasicFX.Light1Tech.Description.PassCount; p++)
                {
                    var pass = Effects.BasicFX.Light1Tech.GetPassByIndex(p);
                    _sphere.Draw(ImmediateContext, pass, _camera.View, _camera.Proj, RenderMode.Basic);
                }
            }

            _terrain.Renderer.Draw(ImmediateContext, _camera, _dirLights);



            ImmediateContext.Rasterizer.State = null;



            _sky.Draw(ImmediateContext, _camera);


            ImmediateContext.Rasterizer.State = null;
            ImmediateContext.OutputMerger.DepthStencilState     = null;
            ImmediateContext.OutputMerger.DepthStencilReference = 0;


            _minimap.Draw(ImmediateContext);
            SwapChain.Present(0, PresentFlags.None);
        }
예제 #11
0
        public override void DrawScene()
        {
            Effects.TerrainFX.SetSsaoMap(_whiteTex);
            Effects.TerrainFX.SetShadowMap(_sMap.DepthMapSRV);
            Effects.TerrainFX.SetShadowTransform(_shadowTransform);
            _minimap.RenderMinimap(_dirLights);

            var view     = _lightView;
            var proj     = _lightProj;
            var viewProj = view * proj;

            _terrain.Renderer.DrawToShadowMap(ImmediateContext, _sMap, viewProj);
            DrawSceneToShadowMap();

            ImmediateContext.Rasterizer.State = null;
            ImmediateContext.ClearDepthStencilView(DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0);
            ImmediateContext.Rasterizer.SetViewports(Viewport);

            _terrain.Renderer.ComputeSsao(ImmediateContext, _camera, _ssao, DepthStencilView);

            ImmediateContext.OutputMerger.SetTargets(DepthStencilView, RenderTargetView);
            ImmediateContext.Rasterizer.SetViewports(Viewport);

            ImmediateContext.ClearRenderTargetView(RenderTargetView, Color.Silver);
            ImmediateContext.ClearDepthStencilView(DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0);

            if (Util.IsKeyDown(Keys.W))
            {
                ImmediateContext.Rasterizer.State = RenderStates.WireframeRS;
            }

            if (Util.IsKeyDown(Keys.S))
            {
                Effects.TerrainFX.SetSsaoMap(_whiteTex);
            }
            else
            {
                Effects.TerrainFX.SetSsaoMap(_ssao.AmbientSRV);
            }
            if (!Util.IsKeyDown(Keys.A))
            {
                Effects.TerrainFX.SetShadowMap(_sMap.DepthMapSRV);
                Effects.TerrainFX.SetShadowTransform(_shadowTransform);
            }
            else
            {
                Effects.TerrainFX.SetShadowMap(_whiteTex);
            }

            Effects.BasicFX.SetEyePosW(_camera.Position);
            Effects.BasicFX.SetDirLights(_dirLights);
            Effects.BasicFX.SetSsaoMap(_whiteTex);

            ImmediateContext.InputAssembler.InputLayout       = InputLayouts.Basic32;
            ImmediateContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
            for (var p = 0; p < Effects.BasicFX.Light1Tech.Description.PassCount; p++)
            {
                var pass = Effects.BasicFX.Light1Tech.GetPassByIndex(p);
                _unit.Render(ImmediateContext, pass, _camera.View, _camera.Proj);
            }

            _terrain.Renderer.Draw(ImmediateContext, _camera, _dirLights);

            ImmediateContext.Rasterizer.State = null;

            _sky.Draw(ImmediateContext, _camera);

            ImmediateContext.Rasterizer.State = null;
            ImmediateContext.OutputMerger.DepthStencilState     = null;
            ImmediateContext.OutputMerger.DepthStencilReference = 0;

            _minimap.Draw(ImmediateContext);

            FontCache.DrawStrings(
                new[] {
                "Currently: " + _unit.Position,
                "Destination: " + _unit.Destination.MapPosition
            },
                Vector2.Zero,
                Color.Yellow
                );
            FontCache.DrawString("bold", "This is bold", new Vector2(Window.ClientSize.Width - 200, 0), Color.Red);
            EndFrame();
        }