public class Scale
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Scale.ScaledResource
Used by
getScaledResources(java.lang.String). |
| Modifier and Type | Field and Description |
|---|---|
float |
factor
The scale factor for HiDPI mode, or 1 if HDPI mode is not enabled.
|
static Scale |
ONE
An unscaled scale factor singleton.
|
| Constructor and Description |
|---|
Scale(float factor) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Scale.ScaledResource> |
getScaledResources(java.lang.String path)
Returns an ordered series of scaled resources to try when loading an asset.
|
float |
invScaled(float length)
Returns the supplied length inverse scaled by our scale factor.
|
int |
invScaledCeil(float length)
Returns the supplied length inverse scaled by our scale factor and rounded up.
|
int |
invScaledFloor(float length)
Returns the supplied length inverse scaled by our scale factor and rounded down.
|
float |
scaled(float length)
Returns the supplied length scaled by our scale factor.
|
int |
scaledCeil(float length)
Returns the supplied length scaled by our scale factor and rounded up.
|
int |
scaledFloor(float length)
Returns the supplied length scaled by our scale factor and rounded down.
|
java.lang.String |
toString() |
public static final Scale ONE
public final float factor
public float scaled(float length)
public int scaledCeil(float length)
public int scaledFloor(float length)
public float invScaled(float length)
public int invScaledFloor(float length)
public int invScaledCeil(float length)
public java.util.List<Scale.ScaledResource> getScaledResources(java.lang.String path)
2, 1, but on a
Retina iPad, it could be 4, 3, 2, 1, and on Android devices it may often be something
like 3, 2, 1 or 2.5, 2, 1.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All Rights Reserved.