Enum Class SpriteBatch.BlendMode

java.lang.Object
java.lang.Enum<SpriteBatch.BlendMode>
edu.cornell.gdiac.graphics.SpriteBatch.BlendMode
All Implemented Interfaces:
Serializable, Comparable<SpriteBatch.BlendMode>, Constable
Enclosing class:
SpriteBatch

public static enum SpriteBatch.BlendMode extends Enum<SpriteBatch.BlendMode>
An enumeration of standard color blending options.

While we allow full control of color blending in our sprite batch, 99% of the time we find that the following blend options are sufficient. Note that these modes apply to a spritebatch/2d graphics pipeline and do not necessarily generalize to other pipelines.

  • Enum Constant Details

    • ALPHA_BLEND

      public static final SpriteBatch.BlendMode ALPHA_BLEND
      Alpha blending on, assuming the colors have no pre-multipled alpha (DEFAULT)
    • PREMULT

      public static final SpriteBatch.BlendMode PREMULT
      Alpha blending on, assuming the colors have pre-multipled alpha (uncommon)
    • ADDITIVE

      public static final SpriteBatch.BlendMode ADDITIVE
      Color values are added together, causing a white-out effect
    • OPAQUE

      public static final SpriteBatch.BlendMode OPAQUE
      Color values are draw on top of one another with no transparency support
  • Method Details

    • values

      public static SpriteBatch.BlendMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SpriteBatch.BlendMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null