Packageorg.flixel
Classpublic class FlxU
InheritanceFlxU Inheritance Object



Public Methods
 MethodDefined By
  
abs(Value:Number):Number
[static]
FlxU
  
bound(Value:Number, Min:Number, Max:Number):Number
[static]
FlxU
  
ceil(Value:Number):Number
[static]
FlxU
  
computeVelocity(Velocity:Number, Acceleration:Number = 0, Drag:Number = 0, Max:Number = 10000):Number
[static] A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.
FlxU
  
endProfile(Start:uint, Name:String = Profiler, Log:Boolean = true):uint
[static] Useful for finding out how long it takes to execute specific blocks of code.
FlxU
  
floor(Value:Number):Number
[static]
FlxU
  
formatArray(A:Array):String
[static]
FlxU
  
formatMoney(Amount:Number, ShowDecimal:Boolean = true):String
[static]
FlxU
  
formatTime(Seconds:Number):String
[static]
FlxU
  
getAngle(Point1:FlxPoint, Point2:FlxPoint):Number
[static] Calculates the angle between two points.
FlxU
  
getClass(Name:String):Class
[static] Look up a Class object by its string name.
FlxU
  
getClassName(Obj:Object, Simple:Boolean = false):String
[static] Get the String name of any Object.
FlxU
  
getDistance(Point1:FlxPoint, Point2:FlxPoint):Number
[static] Calculate the distance between two points.
FlxU
  
getHSB(Color:uint, Results:Array = null):Array
[static] Loads an array with the HSB values of a Flash uint color.
FlxU
  
getRGBA(Color:uint, Results:Array = null):Array
[static] Loads an array with the RGBA values of a Flash uint color.
FlxU
  
makeColor(Red:uint, Green:uint, Blue:uint, Alpha:Number = 1.0):uint
[static] Generate a Flash uint color from RGBA components.
FlxU
  
makeColorFromHSB(Hue:Number, Saturation:Number, Brightness:Number, Alpha:Number = 1.0):uint
[static] Generate a Flash uint color from HSB components.
FlxU
  
max(Number1:Number, Number2:Number):Number
[static]
FlxU
  
min(Number1:Number, Number2:Number):Number
[static]
FlxU
  
openURL(URL:String):void
[static] Opens a web page in a new tab or window.
FlxU
  
rotatePoint(X:Number, Y:Number, PivotX:Number, PivotY:Number, Angle:Number, P:FlxPoint = null):FlxPoint
[static] Rotates a point in 2D space around another point by the given angle.
FlxU
  
srand(Seed:Number):Number
[static] Generates a random number based on the seed provided.
FlxU
  
[static] Useful for finding out how long it takes to execute specific blocks of code.
FlxU
Method Detail
abs()method
public static function abs(Value:Number):Number

Parameters

Value:Number

Returns
Number
bound()method 
public static function bound(Value:Number, Min:Number, Max:Number):Number

Parameters

Value:Number
 
Min:Number
 
Max:Number

Returns
Number
ceil()method 
public static function ceil(Value:Number):Number

Parameters

Value:Number

Returns
Number
computeVelocity()method 
public static function computeVelocity(Velocity:Number, Acceleration:Number = 0, Drag:Number = 0, Max:Number = 10000):Number

A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.

Parameters

Velocity:Number — Any component of velocity (e.g. 20).
 
Acceleration:Number (default = 0) — Rate at which the velocity is changing.
 
Drag:Number (default = 0) — Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set.
 
Max:Number (default = 10000) — An absolute value cap for the velocity.

Returns
Number — The altered Velocity value.
endProfile()method 
public static function endProfile(Start:uint, Name:String = Profiler, Log:Boolean = true):uint

Useful for finding out how long it takes to execute specific blocks of code.

Parameters

Start:uint — A uint created by FlxU.startProfile().
 
Name:String (default = Profiler) — Optional tag (for debug console display). Default value is "Profiler".
 
Log:Boolean (default = true) — Whether or not to log this elapsed time in the debug console.

Returns
uint — A uint to be passed to FlxU.endProfile().
floor()method 
public static function floor(Value:Number):Number

Parameters

Value:Number

Returns
Number
formatArray()method 
public static function formatArray(A:Array):String

Parameters

A:Array

Returns
String
formatMoney()method 
public static function formatMoney(Amount:Number, ShowDecimal:Boolean = true):String

Parameters

Amount:Number
 
ShowDecimal:Boolean (default = true)

Returns
String
formatTime()method 
public static function formatTime(Seconds:Number):String

Parameters

Seconds:Number

Returns
String
getAngle()method 
public static function getAngle(Point1:FlxPoint, Point2:FlxPoint):Number

Calculates the angle between two points. 0 degrees points straight up.

Parameters

Point1:FlxPoint — The X coordinate of the point.
 
Point2:FlxPoint — The Y coordinate of the point.

Returns
Number — The angle in degrees, between -90 and 270.
getClass()method 
public static function getClass(Name:String):Class

Look up a Class object by its string name.

Parameters

Name:String — The String name of the Class you are interested in.

Returns
Class — A Class object.
getClassName()method 
public static function getClassName(Obj:Object, Simple:Boolean = false):String

Get the String name of any Object.

Parameters

Obj:Object — The Object object in question.
 
Simple:Boolean (default = false) — Returns only the class name, not the package or packages.

Returns
String — The name of the Class as a String object.
getDistance()method 
public static function getDistance(Point1:FlxPoint, Point2:FlxPoint):Number

Calculate the distance between two points.

Parameters

Point1:FlxPoint — A FlxPoint object referring to the first location.
 
Point2:FlxPoint — A FlxPoint object referring to the second location.

Returns
Number — The distance between the two points as a floating point Number object.
getHSB()method 
public static function getHSB(Color:uint, Results:Array = null):Array

Loads an array with the HSB values of a Flash uint color. Hue is a value between 0 and 360. Saturation, Brightness and Alpha are as floating point numbers between 0 and 1.

Parameters

Color:uint — The color you want to break into components.
 
Results:Array (default = null) — An optional parameter, allows you to use an array that already exists in memory to store the result.

Returns
Array — An Array object containing the Red, Green, Blue and Alpha values of the given color.
getRGBA()method 
public static function getRGBA(Color:uint, Results:Array = null):Array

Loads an array with the RGBA values of a Flash uint color. RGB values are stored 0-255. Alpha is stored as a floating point number between 0 and 1.

Parameters

Color:uint — The color you want to break into components.
 
Results:Array (default = null) — An optional parameter, allows you to use an array that already exists in memory to store the result.

Returns
Array — An Array object containing the Red, Green, Blue and Alpha values of the given color.
makeColor()method 
public static function makeColor(Red:uint, Green:uint, Blue:uint, Alpha:Number = 1.0):uint

Generate a Flash uint color from RGBA components.

Parameters

Red:uint — The red component, between 0 and 255.
 
Green:uint — The green component, between 0 and 255.
 
Blue:uint — The blue component, between 0 and 255.
 
Alpha:Number (default = 1.0) — How opaque the color should be, either between 0 and 1 or 0 and 255.

Returns
uint — The color as a uint.
makeColorFromHSB()method 
public static function makeColorFromHSB(Hue:Number, Saturation:Number, Brightness:Number, Alpha:Number = 1.0):uint

Generate a Flash uint color from HSB components.

Parameters

Hue:Number — A number between 0 and 360, indicating position on a color strip or wheel.
 
Saturation:Number — A number between 0 and 1, indicating how colorful or gray the color should be. 0 is gray, 1 is vibrant.
 
Brightness:Number — A number between 0 and 1, indicating how bright the color should be. 0 is black, 1 is full bright.
 
Alpha:Number (default = 1.0) — How opaque the color should be, either between 0 and 1 or 0 and 255.

Returns
uint — The color as a uint.
max()method 
public static function max(Number1:Number, Number2:Number):Number

Parameters

Number1:Number
 
Number2:Number

Returns
Number
min()method 
public static function min(Number1:Number, Number2:Number):Number

Parameters

Number1:Number
 
Number2:Number

Returns
Number
openURL()method 
public static function openURL(URL:String):void

Opens a web page in a new tab or window.

Parameters

URL:String — The address of the web page.

rotatePoint()method 
public static function rotatePoint(X:Number, Y:Number, PivotX:Number, PivotY:Number, Angle:Number, P:FlxPoint = null):FlxPoint

Rotates a point in 2D space around another point by the given angle.

Parameters

X:Number — The X coordinate of the point you want to rotate.
 
Y:Number — The Y coordinate of the point you want to rotate.
 
PivotX:Number — The X coordinate of the point you want to rotate around.
 
PivotY:Number — The Y coordinate of the point you want to rotate around.
 
Angle:Number — Rotate the point by this many degrees.
 
P:FlxPoint (default = null) — Optional FlxPoint to store the results in.

Returns
FlxPoint — A FlxPoint containing the coordinates of the rotated point.
srand()method 
public static function srand(Seed:Number):Number

Generates a random number based on the seed provided.

Parameters

Seed:Number — A number between 0 and 1, used to generate a predictable random number (very optional).

Returns
Number — A Number between 0 and 1.
startProfile()method 
public static function startProfile():uint

Useful for finding out how long it takes to execute specific blocks of code.

Returns
uint — A uint to be passed to FlxU.endProfile().