public static var quadTree:FlxQuadTree
The last quad tree you generated will be stored here for reference or whatever.
public static var roundingError:Number = 0.0000001
Helps to eliminate false collisions and/or rendering glitches caused by rounding errors
public static function abs(N:Number):Number
Parameters
Returns
public static function ceil(N:Number):Number
Parameters
Returns
public static function collide(Object1:FlxObject, Object2:FlxObject):Boolean
Call this function to see if one FlxObject
collides with another.
Can be called with one object and one group, or two groups, or two objects,
whatever floats your boat! It will put everything into a quad tree and then
check for collisions. For maximum performance try bundling a lot of objects
together using a FlxGroup
(even bundling groups together!)
NOTE: does NOT take objects' scrollfactor into account.
Parameters
| Object1:FlxObject — The first object or group you want to check.
|
|
| Object2:FlxObject — The second object or group you want to check. If it is the same as the first, flixel knows to just do a comparison within that group.
|
Returns
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.
|
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() .
|
public static function floor(N:Number):Number
Parameters
Returns
public static function getAngle(X:Number, Y:Number):Number
Calculates the angle between a point and the origin (0,0).
Parameters
| X:Number — The X coordinate of the point.
|
|
| Y:Number — The Y coordinate of the point.
|
Returns
| Number — The angle in degrees.
|
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
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.
|
public static function getColor(Red:uint, Green:uint, Blue:uint, Alpha:Number = 1.0):uint
Generate a Flash uint
color from RGBA components.
Parameters
| Red:uint — Red The red component, between 0 and 255.
|
|
| Green:uint — Green The green component, between 0 and 255.
|
|
| Blue:uint — Blue The blue component, between 0 and 255.
|
|
| Alpha:Number (default = 1.0 ) — Alpha How opaque the color should be, either between 0 and 1 or 0 and 255.
|
Returns
| uint — The color as a uint .
|
public static function getColorHSB(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 ) — Alpha How opaque the color should be, either between 0 and 1 or 0 and 255.
|
Returns
| uint — The color as a uint .
|
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.
|
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.
|
public static function max(N1:Number, N2:Number):Number
Parameters
Returns
public static function min(N1:Number, N2:Number):Number
Parameters
Returns
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.
|
public static function overlap(Object1:FlxObject, Object2:FlxObject, Callback:Function = null):Boolean
Call this function to see if one FlxObject
overlaps another.
Can be called with one object and one group, or two groups, or two objects,
whatever floats your boat! It will put everything into a quad tree and then
check for overlaps. For maximum performance try bundling a lot of objects
together using a FlxGroup
(even bundling groups together!)
NOTE: does NOT take objects' scrollfactor into account.
Parameters
| Object1:FlxObject — The first object or group you want to check.
|
|
| Object2:FlxObject — The second object or group you want to check. If it is the same as the first, flixel knows to just do a comparison within that group.
|
|
| Callback:Function (default = null ) — A function with two FlxObject parameters - e.g. myOverlapFunction(Object1:FlxObject,Object2:FlxObject); If no function is provided, FlxQuadTree will call kill() on both objects.
|
Returns
public static function random(Seed:Number):Number
Generates a random number. NOTE: To create a series of predictable
random numbers, add the random number you generate each time
to the Seed
value before calling random()
again.
Parameters
| Seed:Number — A user-provided value used to calculate a predictable random number.
|
Returns
| Number — A Number between 0 and 1.
|
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.
|
public static function setWorldBounds(X:Number = 0, Y:Number = 0, Width:Number = 0, Height:Number = 0, Divisions:uint = 3):void
Call this function to specify a more efficient boundary for your game world.
This boundary is used by overlap()
and collide()
, so it
can't hurt to have it be the right size! Flixel will invent a size for you, but
it's pretty huge - 256x the size of the screen, whatever that may be.
Leave width and height empty if you want to just update the game world's position.
Parameters
| X:Number (default = 0 ) — The X-coordinate of the left side of the game world.
|
|
| Y:Number (default = 0 ) — The Y-coordinate of the top of the game world.
|
|
| Width:Number (default = 0 ) — Desired width of the game world.
|
|
| Height:Number (default = 0 ) — Desired height of the game world.
|
|
| Divisions:uint (default = 3 ) — Pass a non-zero value to set quadTreeDivisions . Default value is 3.
|
public static function solveXCollision(Object1:FlxObject, Object2:FlxObject):Boolean
This quad tree callback function can be used externally as well.
Takes two objects and separates them along their X axis (if possible/reasonable).
Parameters
| Object1:FlxObject — The first object or group you want to check.
|
|
| Object2:FlxObject — The second object or group you want to check.
|
Returns
public static function solveYCollision(Object1:FlxObject, Object2:FlxObject):Boolean
This quad tree callback function can be used externally as well.
Takes two objects and separates them along their Y axis (if possible/reasonable).
Parameters
| Object1:FlxObject — The first object or group you want to check.
|
|
| Object2:FlxObject — The second object or group you want to check.
|
Returns
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() .
|