public enum Scaling extends Enum<Scaling>
Enum Constant and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
Vector2 |
apply(float sourceWidth,
float sourceHeight,
float targetWidth,
float targetHeight)
Returns the size of the source scaled to the target.
|
static Scaling |
valueOf(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.
|
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
public static Scaling[] values()
for (Scaling c : Scaling.values()) System.out.println(c);
public static Scaling valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Vector2 apply(float sourceWidth, float sourceHeight, float targetWidth, float targetHeight)
Copyright © 2016. All rights reserved.