|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Scaling>
com.badlogic.gdx.utils.Scaling
public enum Scaling
Various scaling types for fitting one rectangle into another.
Enum Constant Summary | |
---|---|
fill
Scales the source to fill the target while keeping the same aspect ratio. |
|
fillX
Scales the source to fill the target in the x direction while keeping the same aspect ratio. |
|
fillY
Scales the source to fill the target in the y direction while keeping the same aspect ratio. |
|
fit
Scales the source to fit the target while keeping the same aspect ratio. |
|
none
The source is not scaled. |
|
stretch
Scales the source to fill the target. |
|
stretchX
Scales the source to fill the target in the x direction, without changing the y direction. |
|
stretchY
Scales the source to fill the target in the y direction, without changing the x direction. |
Method Summary | |
---|---|
Vector2 |
apply(float sourceWidth,
float sourceHeight,
float targetWidth,
float targetHeight)
Returns the size of the source scaled to the target. |
static Scaling |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Scaling[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Scaling fit
public static final Scaling fill
public static final Scaling fillX
public static final Scaling fillY
public static final Scaling stretch
public static final Scaling stretchX
public static final Scaling stretchY
public static final Scaling none
Method Detail |
---|
public static Scaling[] values()
for (Scaling c : Scaling.values()) System.out.println(c);
public static Scaling valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic Vector2 apply(float sourceWidth, float sourceHeight, float targetWidth, float targetHeight)
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |