MoodSwingGame.MSChangeableBuilding.DrawLoadingBar C# (CSharp) Method

DrawLoadingBar() public method

public DrawLoadingBar ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public void DrawLoadingBar(GameTime gameTime)
        {
            if (State == MSChangeableBuildingState.TRANSFORMING || State == MSChangeableBuildingState.WAITING)
            {
                Vector3 v = MoodSwing.GetInstance().GraphicsDevice.Viewport.Project(Position + new Vector3(0, 0, 20), // <- offset for progress bar
                    MSCamera.GetInstance().ProjectionMatrix, MSCamera.GetInstance().GetView(),
                    Matrix.Identity);
                progressBar.Progress = timeCount / buildTime;
                progressBar.Position = new Vector2(v.X - MSMap.tileDimension/2, v.Y - MSMap.tileDimension);
                progressBar.Draw(gameTime);
            }
        }