Exemple #1
0
        public override void Render(SpriteBatch spriteBatch)
        {
            Vector2 sides     = VectorHelper.CalculateScale(VectorHelper.GetTextureSize(temp), new Vector2(5.0f, owner.SizeInPixels.Y));
            Vector2 topBottom = VectorHelper.CalculateScale(VectorHelper.GetTextureSize(temp), new Vector2(owner.SizeInPixels.X, 5.0f));

            // Vasen.
            spriteBatch.Draw(
                temp,
                owner.Position,
                null,
                owner.Brush.Foreground,
                0.0f,
                Vector2.Zero,
                sides,
                SpriteEffects.None,
                0.0f);

            // Oikea.
            spriteBatch.Draw(
                temp,
                new Vector2(owner.Area.Right - sides.X, owner.Position.Y),
                null,
                owner.Brush.Foreground,
                0.0f,
                Vector2.Zero,
                sides,
                SpriteEffects.None,
                0.0f);

            // Ala.
            spriteBatch.Draw(
                temp,
                new Vector2(owner.Position.X, owner.Area.Bottom - topBottom.Y),
                null,
                owner.Brush.Foreground,
                0.0f,
                Vector2.Zero,
                topBottom,
                SpriteEffects.None,
                0.0f);

            // Ylä.
            spriteBatch.Draw(
                temp,
                new Vector2(owner.Position.X, owner.Area.Top),
                null,
                owner.Brush.Foreground,
                0.0f,
                Vector2.Zero,
                topBottom,
                SpriteEffects.None,
                0.0f);
        }
 public override void Render(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(
         texture,
         owner.Position,
         null,
         owner.Brush.Foreground,
         0.0f,
         Vector2.Zero,
         VectorHelper.CalculateScale(new Vector2(texture.Width, texture.Height), owner.SizeInPixels),
         SpriteEffects.None,
         0.0f);
 }
Exemple #3
0
 public override void Render(SpriteBatch spriteBatch, Vector2 cursorPosition, Vector2 cursorSize)
 {
     spriteBatch.Draw(
         sprite.Texture,
         cursorPosition,
         null,
         null,
         sprite.Origin,
         sprite.Rotation,
         VectorHelper.CalculateScale(sprite.Size, cursorSize),
         sprite.Color,
         sprite.Effect,
         0.0f);
 }
 public override void Render(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(
         temp,
         owner.Position,
         null,
         null,
         Vector2.Zero,
         0.0f,
         VectorHelper.CalculateScale(new Vector2(1, 1), owner.SizeInPixels),
         owner.Brush.Foreground,
         SpriteEffects.None,
         0.0f);
 }
 public override void Render(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(
         owner.Sprite.Texture,
         owner.Position,
         null,
         owner.Sprite.Source,
         owner.Sprite.Origin,
         owner.Sprite.Rotation,
         VectorHelper.CalculateScale(owner.Sprite.Size, owner.SizeInPixels),
         owner.Sprite.Color,
         owner.Sprite.Effect,
         0.0f);
 }
Exemple #6
0
        public override void Render(SpriteBatch spriteBatch)
        {
            Vector2 size  = owner.Font.MeasureString(owner.Text);
            Vector2 scale = VectorHelper.CalculateScale(size, owner.SizeInPixels);

            spriteBatch.DrawString(
                owner.Font,
                owner.Text,
                owner.Position,
                owner.Brush.Foreground,
                0.0f,
                Vector2.Zero,
                scale,
                SpriteEffects.None,
                0.0f);
        }
        public override void Render(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(
                owner.Sprite.Texture,
                owner.Position,
                null,
                null,
                owner.Sprite.Origin,
                owner.Sprite.Rotation,
                VectorHelper.CalculateScale(owner.Sprite.Size, owner.SizeInPixels),
                owner.Sprite.Color,
                owner.Sprite.Effect,
                0.0f);

            spriteBatch.Draw(
                owner.Sprite.Texture,
                new Vector2(owner.Position.X + disortX, owner.Position.Y + disortY),
                null,
                null,
                owner.Sprite.Origin,
                owner.Sprite.Rotation,
                VectorHelper.CalculateScale(owner.Sprite.Size, owner.SizeInPixels),
                new Color(255, 255, 255, 125),
                owner.Sprite.Effect,
                0.0f);

            spriteBatch.Draw(
                owner.Sprite.Texture,
                new Vector2(owner.Position.X - disortX, owner.Position.Y - disortY),
                null,
                null,
                owner.Sprite.Origin,
                owner.Sprite.Rotation,
                VectorHelper.CalculateScale(owner.Sprite.Size, owner.SizeInPixels),
                new Color(255, 255, 255, 125),
                owner.Sprite.Effect,
                0.0f);
        }