/// <summary> /// Construct the element, using a <see cref="DrawTargetTexture2D"/> as the texture source /// </summary> /// <param name="sizeInPixels"></param> /// <param name="textureSource"></param> public TexturedElement(DrawTargetTexture2D textureSource, Vector2 sizeInPixels) : base(sizeInPixels) { if (textureSource == null) throw new ArgumentNullException(); this.texture = textureSource.GetTexture(); this.textureSource = textureSource; }
/// <summary> /// Construct the element, using a <see cref="DrawTargetTexture2D"/> as the texture source /// </summary> /// <param name="textureSource"></param> /// <param name="size">If Normalised, the position and size are stored as [0,1] range. Otherwise the position and size are measured in pixels</param> /// <param name="normalised"></param> public TexturedElement(DrawTargetTexture2D textureSource, Vector2 size, bool normalised) : base(size,normalised) { if (textureSource == null) throw new ArgumentNullException(); this.texture = textureSource.GetTexture(); this.textureSource = textureSource; }