FSO.LotView.World3D.DrawAfter2D C# (CSharp) Method

DrawAfter2D() public method

public DrawAfter2D ( Microsoft.Xna.Framework.Graphics.GraphicsDevice gd, FSO.LotView.WorldState state ) : void
gd Microsoft.Xna.Framework.Graphics.GraphicsDevice
state FSO.LotView.WorldState
return void
        public void DrawAfter2D(GraphicsDevice gd, WorldState state)
        {
            var pxOffset = state.WorldSpace.GetScreenOffset();
            var _2d = state._2D;
            foreach (var avatar in Blueprint.Avatars)
            {
                if ((avatar.Position.Z + 0.05f) / 2.95f < state.Level)
                {
                    _2d.OffsetPixel(state.WorldSpace.GetScreenFromTile(avatar.Position));
                    _2d.OffsetTile(avatar.Position);
                    avatar.Draw(gd, state);
                }
            }
        }

Usage Example

示例#1
0
        protected virtual void InternalDraw(GraphicsDevice device)
        {
            device.RasterizerState = RasterizerState.CullNone;
            State.PrepareLighting();
            State._2D.OutputDepth = true;

            State._3D.Begin(device);
            State._2D.Begin(this.State.Camera);

            var pxOffset = -State.WorldSpace.GetScreenOffset();

            //State._2D.PreciseZoom = State.PreciseZoom;
            State._2D.ResetMatrices(device.Viewport.Width, device.Viewport.Height);
            _3DWorld.DrawBefore2D(device, State);

            _2DWorld.Draw(device, State);

            State._2D.Pause();
            State._2D.Resume();

            _3DWorld.DrawAfter2D(device, State);
            State._2D.SetScroll(pxOffset);
            State._2D.End();
            State._3D.End();

            foreach (var particle in Blueprint.Particles)
            {
                particle.Draw(device, State);
            }

            State._2D.OutputDepth = false;
        }
All Usage Examples Of FSO.LotView.World3D::DrawAfter2D