/// <summary> /// Create a new Sprite with default values. /// </summary> protected Sprite() { Tint = Color.White; overrideAtt = SpriteAttributes.None; }
/// <summary> /// Some attributes about a Sprite can be determined by it's animation. This function allows the determination of what attributes are allowed to be set by the animation and what are user determined. /// </summary> /// <param name="component">What component of the Sprite should be get/set.</param> /// <param name="allowed"><code>true</code> if this compoennt can be overriden by the Sprite's animation, <code>false</code> is otherwise. Can also be set to <code>null</code> if the value should be returned.</param> /// <returns><code>true</code> if the the Sprite's animation can override the developer setting, <code>false</code> if otherwise.</returns> public bool OverrideAnimation(SpriteAttributes component, bool? allowed) { if (allowed.HasValue) { if (allowed.Value) { overrideAtt |= component; } else { overrideAtt &= ~component; } return allowed.Value; } else { return (overrideAtt & component) == component; } }