예제 #1
0
        public virtual void Draw(GameTime gameTime)
        {
            foreach (MapTile tile in DrawnMap)
            {
                MapRender.Draw(
                    MapSpriteSheet.Sprite(CharToTile[tile.ModelChar]),
                    tile.Position,
                    0.1f,
                    Color.White,
                    0,
                    1,
                    SpriteEffects.None);
            }

            foreach (MapTile tile in DrawnMap)
            {
                if (tile.IsCollidable)
                {
                    if (DebugConstants.ShowBoundingBoxes)
                    {
                        BoundingBoxHelper.DrawRectangle(tile.BoundingBox, GlobalAssets.BBoxOutline, Color.White, MapBatch, false, 1);
                    }

                    if ((tile.IsBeingCollided || tile.IsBeingStoodOn) && DebugConstants.ShowCollisionOverlays)
                    {
                        BoundingBoxHelper.DrawRectangle(tile.BoundingBox, GlobalAssets.CollisionOverlay, Color.White, MapBatch, true, 1);
                    }
                }
            }
        }
        public void Draw(GameTime deltaTime, Entity entity)
        {
            var currentFrame = _currentAnimation.GetCurrentFrame();

            _spriteRender.Draw(currentFrame.SpriteFrame,
                               new Vector2(entity.Position.X, entity.Position.Y),
                               .5f,
                               Color.White,
                               rotation: 0,
                               scale: entity.Scale,
                               spriteEffects: currentFrame.SpriteEffect);

            if (DebugConstants.ShowBoundingBoxes)
            {
                BoundingBoxHelper.DrawRectangle(entity.BoundingBox, GlobalAssets.BBoxOutline, Color.White, _spriteBatch, false, 1);
            }
        }