Enum Class Primitive.Unit
- All Implemented Interfaces:
Serializable
,Comparable<Primitive.Unit>
,Constable
- Enclosing interface:
Primitive
Style units
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBase value is multiplied by the width of the '0' characterBase value is 1/100th the size of a block in the gameRepresents an angle in degrees.Represents an angle in gradians.Base value is 1x the size of a block in the gameNo modification of the base value is doneBase value is 1/100th of the size of the parent elementBase value is multiplied by the size of a pixelRepresents an angle in radians.Represents an angle in a number of turns around the circle.Base value is a percentage of the screen's heightBase value is a percentage of the screen's width -
Method Summary
Modifier and TypeMethodDescriptionstatic Primitive.Unit[]
Get an array of angular units.getUnit()
Get a string representation of the unit.toString()
static Primitive.Unit
Returns the enum constant of this class with the specified name.static Primitive.Unit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No modification of the base value is done -
PX
Base value is multiplied by the size of a pixel -
CH
Base value is multiplied by the width of the '0' character -
VW
Base value is a percentage of the screen's width -
VH
Base value is a percentage of the screen's height -
M
Base value is 1x the size of a block in the game -
CM
Base value is 1/100th the size of a block in the game -
PERCENT
Base value is 1/100th of the size of the parent element -
DEG
Represents an angle in degrees. A full circle is 360 degrees. -
GRAD
Represents an angle in gradians. A full circle is 400 gradians. -
RAD
Represents an angle in radians. A full circle is approximately 6.2832 radians. -
TURN
Represents an angle in a number of turns around the circle. A full circle is 1 turn.
-
-
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
-
angleUnits
Get an array of angular units. (IncludesNONE
)- Returns:
- Angle unit array
-
getUnit
-
toString
- Overrides:
toString
in classEnum<Primitive.Unit>
-