Package com.badlogic.gdx.utils
Class Scaling
java.lang.Object
com.badlogic.gdx.utils.Scaling
Various scaling types for fitting one rectangle into another.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Scaling
Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions.static final Scaling
Scales the source to fill the target while keeping the same aspect ratio.static final Scaling
Scales the source to fill the target in the x direction while keeping the same aspect ratio.static final Scaling
Scales the source to fill the target in the y direction while keeping the same aspect ratio.static final Scaling
Scales the source to fit the target while keeping the same aspect ratio.static final Scaling
The source is not scaled.static final Scaling
Scales the source to fill the target.static final Scaling
Scales the source to fill the target in the x direction, without changing the y direction.static final Scaling
Scales the source to fill the target in the y direction, without changing the x direction.protected static final Vector2
-
Constructor Summary
-
Method Summary
-
Field Details
-
temp
-
fit
Scales the source to fit the target while keeping the same aspect ratio. This may cause the source to be smaller than the target in one direction. -
contain
Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions. This may cause the source to be smaller than the target in one or both directions. -
fill
Scales the source to fill the target while keeping the same aspect ratio. This may cause the source to be larger than the target in one direction. -
fillX
Scales the source to fill the target in the x direction while keeping the same aspect ratio. This may cause the source to be smaller or larger than the target in the y direction. -
fillY
Scales the source to fill the target in the y direction while keeping the same aspect ratio. This may cause the source to be smaller or larger than the target in the x direction. -
stretch
Scales the source to fill the target. This may cause the source to not keep the same aspect ratio. -
stretchX
Scales the source to fill the target in the x direction, without changing the y direction. This may cause the source to not keep the same aspect ratio. -
stretchY
Scales the source to fill the target in the y direction, without changing the x direction. This may cause the source to not keep the same aspect ratio. -
none
The source is not scaled.
-
-
Constructor Details
-
Scaling
public Scaling()
-
-
Method Details
-
apply
public abstract Vector2 apply(float sourceWidth, float sourceHeight, float targetWidth, float targetHeight) Returns the size of the source scaled to the target. Note the same Vector2 instance is always returned and should never be cached.
-