Exemple #1
0
        public override void DrawWithoutEffect(SpriteBatch spriteBatch)
        {
            var drawPosition = MapPosition.GetScreenPosition();
            var barWidth     = (int)(SpriteWidth * 0.6);
            var barHeight    = 3;
            var barDrawX     = (int)(drawPosition.X - (barWidth / 2));
            var barDrawY     = (int)drawPosition.Y + 5;

            // Health bar
            var currentHealthWidth = (int)(GetBaseAbilityScore(AbilityScore.Health) / CurrentMaxHealth * barWidth);

            spriteBatch.Draw(fullHealthTexture, new Rectangle(barDrawX, barDrawY, currentHealthWidth, barHeight), Color.White);
            var emptyHealthWidth = barWidth - currentHealthWidth;

            spriteBatch.Draw(emptyHealthTexture, new Rectangle(barDrawX + currentHealthWidth, barDrawY, emptyHealthWidth, barHeight), Color.White);

            // Initiative bar
            var currentInitiativeWidth = (int)((1 - InitiativeModifierPercent) * barWidth);

            spriteBatch.Draw(initiativeTexture, new Rectangle(barDrawX, barDrawY + barHeight + 1, currentInitiativeWidth, barHeight), Color.White);

            // Bar frames
            spriteBatch.Draw(blackTexture, new Rectangle(barDrawX - 1, barDrawY - 1, barWidth + 1, 1), Color.White);                                    // Top
            spriteBatch.Draw(blackTexture, new Rectangle(barDrawX - 1, barDrawY + barHeight, barWidth + 1, 1), Color.White);                            // Middle
            spriteBatch.Draw(blackTexture, new Rectangle(barDrawX - 1, barDrawY + barHeight + barHeight, barWidth + 1, 1), Color.White);                // Bottom
            spriteBatch.Draw(blackTexture, new Rectangle(barDrawX - 1, barDrawY - 1, 1, barHeight + barHeight + 1), Color.White);                       // Left
            spriteBatch.Draw(blackTexture, new Rectangle(barDrawX + barWidth, barDrawY - 1, 1, barHeight + barHeight + 1), Color.White);                // Right
        }
Exemple #2
0
        public override void DrawWithEffect(SpriteBatch spriteBatch)
        {
            var drawPosition = MapPosition.GetScreenPosition();

            drawPosition.Y -= MapPoint.TileHeight_Half + MapPoint.TileHeight; // this calculation may not be related to these values, not sure whats up here
            drawPosition.X += 5;                                              // just a little bump
            spriteBatch.Draw(animatedSprite[Facing], drawPosition);
        }
Exemple #3
0
        public override void DrawWithoutEffect(SpriteBatch spriteBatch)
        {
            var drawPosition = MapPosition.GetScreenPosition();

            drawPosition.Y -= Sprite.Height - MapPoint.TileHeight;
            drawPosition.X -= Sprite.Width / 2;
            spriteBatch.Draw(Sprite, drawPosition, Color.White);
        }
Exemple #4
0
        public void DrawLock(SpriteBatch spriteBatch)
        {
            var drawPosition = MapPosition.GetScreenPosition();

            drawPosition.Y -= SpriteHeight - (lockSprite.Height / 2);
            drawPosition.X -= lockSprite.Width / 2;

            spriteBatch.Draw(lockSprite, drawPosition, Color.White);
        }