Package org.openpatch.scratch
Enum Class TextureSampling
- All Implemented Interfaces:
Serializable,Comparable<TextureSampling>,Constable
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();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSmoothed both ways, using one level of detail at a time.Nearest pixel when drawn larger, smoothed when drawn smaller.Nearest pixel, whether the picture is drawn larger or smaller.Smoothed both ways and between levels of detail, which gives the best quality when a picture is drawn much smaller than it is. -
Method Summary
Modifier and TypeMethodDescriptionintgetMode()Returns the number the graphics library uses for this setting.static TextureSamplingReturns the enum constant of this class with the specified name.static TextureSampling[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
POINT
Nearest pixel, whether the picture is drawn larger or smaller. Keeps pixel art crisp. -
LINEAR
Nearest pixel when drawn larger, smoothed when drawn smaller. -
BILINEAR
Smoothed both ways, using one level of detail at a time. This is the default. -
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
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
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 nameNullPointerException- if the argument is null
-
getMode
public int getMode()Returns the number the graphics library uses for this setting.- Returns:
- the mode number
-