Esempio n. 1
0
        private void calculateBounds()
        {
            labelPos   = hitbox.Location;
            textPos    = labelPos;
            textPos.X += labelDim.X;

            labelBounds = labelPatch.getPaddedBounds(labelPos, labelDim, scale);
            textBounds  = textPatch.getPaddedBounds(textPos, textDim, scale);
        }
Esempio n. 2
0
        private void calculateBounds()
        {
            if (patch == null)
            {
                return;
            }

            contentBounds = patch.getPaddedBounds(position.ToPoint(), dimensions, scale);
        }
Esempio n. 3
0
        public void draw(SpriteBatch spriteBatch)
        {
            patch.draw(spriteBatch, (position + patchOffset).ToPoint(), dimensions, scale);

            string drawText = text.Substring(0, charsToDraw);

            Rectangle contentBounds = patch.getPaddedBounds((position + patchOffset).ToPoint(), dimensions, scale);
            Vector2   diff          = ScaleManager.LargeFont.MeasureString(drawText) - contentBounds.Size.ToVector2();
            Vector2   textPos       = contentBounds.Location.ToVector2() - (diff / 2f);

            spriteBatch.DrawString(ScaleManager.LargeFont, drawText, textPos, Color.White);
        }
Esempio n. 4
0
 private void calculateBounds()
 {
     contentBounds = patch.getPaddedBounds(hitbox.Location, hitbox.Size, scale);
 }