Packagestencyl.api.engine.utils
Classpublic class Util
InheritanceUtil Inheritance Object



Public Methods
 MethodDefined By
  
Util
  
addLeadingZero(n:Number):String
[static] Formats a number to include a leading zero if it is a single digit between -1 and 10.
Util
  
HexToRGB(hex:uint):Array
[static]
Util
  
RGBToHex(r:uint, g:uint, b:uint):uint
[static]
Util
  
toBoolean(s:String):Boolean
[static]
Util
  
toDegrees(radians:Number):Number
[static]
Util
  
toHex(n:int, bigEndian:Boolean = false):String
[static] Outputs the hex value of a int, allowing the developer to specify the endinaness in the process.
Util
  
toRadians(degrees:Number):Number
[static]
Util
Constructor Detail
Util()Constructor
public function Util()



Method Detail
addLeadingZero()method
public static function addLeadingZero(n:Number):String

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9.0

Formats a number to include a leading zero if it is a single digit between -1 and 10.

Parameters

n:Number — The number that will be formatted

Returns
String — A string with single digits between -1 and 10 padded with a leading zero.
HexToRGB()method 
public static function HexToRGB(hex:uint):Array

Parameters

hex:uint

Returns
Array
RGBToHex()method 
public static function RGBToHex(r:uint, g:uint, b:uint):uint

Parameters

r:uint
 
g:uint
 
b:uint

Returns
uint
toBoolean()method 
public static function toBoolean(s:String):Boolean

Parameters

s:String

Returns
Boolean
toDegrees()method 
public static function toDegrees(radians:Number):Number

Parameters

radians:Number

Returns
Number
toHex()method 
public static function toHex(n:int, bigEndian:Boolean = false):String

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9.0

Outputs the hex value of a int, allowing the developer to specify the endinaness in the process. Hex output is lowercase.

Parameters

n:int — The int value to output as hex
 
bigEndian:Boolean (default = false) — Flag to output the int as big or little endian

Returns
String — A string of length 8 corresponding to the hex representation of n ( minus the leading "0x" )
toRadians()method 
public static function toRadians(degrees:Number):Number

Parameters

degrees:Number

Returns
Number