Advertisement
Guest User

BackgroundTextureDefinition

a guest
May 26th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using ArbitraryPixel.Common.Graphics;
  2. using Microsoft.Xna.Framework;
  3. using System;
  4.  
  5. namespace ArbitraryPixel.Common.Screen
  6. {
  7.     /// <summary>
  8.     /// Implements ITextureDefinition.
  9.     /// </summary>
  10.     public class BackgroundTextureDefinition
  11.     {
  12.         /// <summary>
  13.         /// The texture data.
  14.         /// </summary>
  15.         public ITexture2D Texture { get; private set; } = null;
  16.  
  17.         /// <summary>
  18.         /// A mask to apply to the texture when drawn, multiplying each texture RGB value by the mask RGB value.
  19.         /// </summary>
  20.         public Color Mask { get; private set; } = Color.Black;
  21.  
  22.         /// <summary>
  23.         /// Create a new object.
  24.         /// </summary>
  25.         /// <param name="texture">The texure to use.</param>
  26.         /// <param name="mask">The mask to use.</param>
  27.         public BackgroundTextureDefinition(ITexture2D texture, Color mask)
  28.         {
  29.             this.Texture = texture ?? throw new ArgumentNullException();
  30.             this.Mask = mask;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement