Enum Class TextureSampling

java.lang.Object
java.lang.Enum<TextureSampling>
org.openpatch.scratch.TextureSampling
All Implemented Interfaces:
Serializable, Comparable<TextureSampling>, Constable

public enum TextureSampling extends Enum<TextureSampling>
How pictures are smoothed when they are drawn larger or smaller than they really are.

The default, BILINEAR, suits most projects. Pixel art is the usual reason to change it: POINT keeps the pixels sharp and square instead of blurring them together.


 Window.useTextureSampling(TextureSampling.POINT);
 new MyStage();
 
See Also:
  • Enum Constant Details

    • POINT

      public static final TextureSampling POINT
      Nearest pixel, whether the picture is drawn larger or smaller. Keeps pixel art crisp.
    • LINEAR

      public static final TextureSampling LINEAR
      Nearest pixel when drawn larger, smoothed when drawn smaller.
    • BILINEAR

      public static final TextureSampling BILINEAR
      Smoothed both ways, using one level of detail at a time. This is the default.
    • TRILINEAR

      public static final TextureSampling TRILINEAR
      Smoothed both ways and between levels of detail, which gives the best quality when a picture is drawn much smaller than it is.
  • Method Details

    • values

      public static TextureSampling[] 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 TextureSampling 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
    • getMode

      public int getMode()
      Returns the number the graphics library uses for this setting.
      Returns:
      the mode number