Package | org.flixel |
Class | public class FlxG |
Inheritance | FlxG Object |
Property | Defined By | ||
---|---|---|---|
buffer : BitmapData [static]
Reference to the active graphics buffer. | FlxG | ||
debug : Boolean [static]
Whether you are running in Debug or Release mode. | FlxG | ||
elapsed : Number [static]
Represents the amount of time in seconds that passed since last frame. | FlxG | ||
fade : FlxFade [static]
A special effect that fades a color onto the screen. | FlxG | ||
flash : FlxFlash [static]
A special effect that flashes a color on the screen. | FlxG | ||
followLead : Point [static]
Used to force the camera to look ahead of the followTarget. | FlxG | ||
followLerp : Number [static]
Used to smoothly track the camera as it follows. | FlxG | ||
followMax : Point [static]
Stores the bottom and right edges of the camera area. | FlxG | ||
followMin : Point [static]
Stores the top and left edges of the camera area. | FlxG | ||
followTarget : FlxObject [static]
Tells the camera to follow this FlxCore object around. | FlxG | ||
framerate : uint [static]
The desired framerate for the game; default is 60. | FlxG | ||
frameratePaused : uint [static]
The desired framerate while paused; default is 10. | FlxG | ||
_game : FlxGame [static]
Internal tracker for game object (so we can pause and unpause)
| FlxG | ||
height : uint [static]
The height of the screen in game pixels. | FlxG | ||
keys : FlxKeyboard [static]
A reference to a FlxKeyboard object. | FlxG | ||
kong : FlxKong [static]
Access to the Kongregate high scores and achievements API. | FlxG | ||
level : int [static] | FlxG | ||
levels : Array [static]
FlxG.levels and FlxG.scores are generic
global variables that can be used for various cross-state stuff. | FlxG | ||
LIBRARY_MAJOR_VERSION : uint = 2 [static]
Assign a major version to your library. | FlxG | ||
LIBRARY_MINOR_VERSION : uint = 32 [static]
Assign a minor version to your library. | FlxG | ||
LIBRARY_NAME : String = flixel [static]
If you build and maintain your own version of flixel,
you can give it your own name here. | FlxG | ||
maxElapsed : Number [static]
Essentially locks the framerate to a minimum value - any slower and you'll get slowdown instead of frameskip; default is 1/30th of a second. | FlxG | ||
mouse : FlxMouse [static]
A reference to a FlxMouse object. | FlxG | ||
music : FlxSound [static]
A handy container for a background music object. | FlxG | ||
mute : Boolean [static]
Set mute to true to turn off the sound. | FlxG | ||
panel : FlxPanel [static]
The support panel (twitter, reddit, stumbleupon, paypal, etc) visor thing
| FlxG | ||
pause : Boolean [static]
Set pause to true to pause the game, all sounds, and display the pause popup. | FlxG | ||
quake : FlxQuake [static]
A special effect that shakes the screen. | FlxG | ||
save : int [static] | FlxG | ||
saves : Array [static]
FlxG.saves is a generic bucket for storing
FlxSaves so you can access them whenever you want. | FlxG | ||
score : int [static] | FlxG | ||
scores : Array [static] | FlxG | ||
scroll : Point [static]
Stores the basic parallax scrolling values. | FlxG | ||
sounds : Array [static]
A list of all the sounds being played in the game. | FlxG | ||
stage : Stage [static] [read-only]
Retrieves the Flash stage object (required for event listeners)
| FlxG | ||
state : FlxState [static]
Safely access the current game state. | FlxG | ||
timeScale : Number [static]
How fast or slow time should pass in the game; default is 1.0. | FlxG | ||
volume : Number [static]
Set volume to a number between 0 and 1 to change the global volume. | FlxG | ||
width : uint [static]
The width of the screen in game pixels. | FlxG | ||
workaround : Bitmap [static] | FlxG |
Property | Defined By | ||
---|---|---|---|
_cache : Object [static]
Internal storage system to prevent graphics from being used repeatedly in memory. | FlxG | ||
_mute : Boolean [static]
Internal flag for whether or not the game is muted. | FlxG | ||
_pause : Boolean [static]
Internal tracker for game pause state. | FlxG | ||
_scrollTarget : Point [static]
Internal, used to assist camera and scrolling. | FlxG | ||
_volume : Number [static]
Internal volume level, used for global sound control. | FlxG |
Method | Defined By | ||
---|---|---|---|
addBitmap(Graphic:Class, Reverse:Boolean = false, Unique:Boolean = false, Key:String = null):BitmapData [static]
Loads a bitmap from a file, caches it, and generates a horizontally flipped version if necessary. | FlxG | ||
addLoadedBitmap(Graphic:Bitmap, Reverse:Boolean = false, Unique:Boolean = false):BitmapData [static] | FlxG | ||
checkBitmapCache(Key:String):Boolean [static]
Check the local bitmap cache to see if a bitmap with this key has been loaded already. | FlxG | ||
createBitmap(Width:uint, Height:uint, Color:uint, Unique:Boolean = false, Key:String = null):BitmapData [static]
Generates a new BitmapData object (a colored square) and caches it. | FlxG | ||
createBitmapSimple(key:String, Graphic:Bitmap):BitmapData [static] | FlxG | ||
destroySounds(ForceDestroy:Boolean = false):void [static]
Called by FlxGame on state changes to stop and destroy sounds. | FlxG | ||
disableDefaultHotKeys():void [static]
Disable Fixel's default hot key controls
| FlxG | ||
disablePauseOnFocusLost():void [static]
Disable pausing on focus lost
| FlxG | ||
doFollow():void [static]
Internal function that updates the camera and parallax scrolling. | FlxG | ||
enableDefaultHotKeys():void [static]
Enable Fixel's default hot key controls
| FlxG | ||
enablePauseOnFocusLost():void [static]
Enable pausing on focus lost
| FlxG | ||
[static]
Tells the camera subsystem what FlxCore object to follow. | FlxG | ||
followAdjust(LeadX:Number = 0, LeadY:Number = 0):void [static]
Specify an additional camera component - the velocity-based "lead",
or amount the camera should track in front of a sprite. | FlxG | ||
followBounds(MinX:int = 0, MinY:int = 0, MaxX:int = 0, MaxY:int = 0, UpdateWorldBounds:Boolean = true):void [static]
Specify the boundaries of the level or where the camera is allowed to move. | FlxG | ||
getMuteValue():uint [static]
Get a number that represents the mute state that we can multiply into a sound transform. | FlxG | ||
log(Data:Object):void [static]
Log data to the developer console. | FlxG | ||
[static]
Creates a new sound object from an embedded Class object. | FlxG | ||
playMusic(Music:Class, Volume:Number = 1.0):void [static]
Set up and play a looping background soundtrack. | FlxG | ||
resetInput():void [static]
Reset the input helper objects (useful when changing screens or states)
| FlxG | ||
setGameData(Game:FlxGame, Width:uint, Height:uint, Zoom:uint):void [static]
Called by FlxGame to set up FlxG during FlxGame's constructor. | FlxG | ||
[static]
Creates a new sound object from a URL. | FlxG | ||
unfollow():void [static]
Stops and resets the camera. | FlxG | ||
updateInput():void [static]
Calls update on the keyboard and mouse input tracking objects. | FlxG | ||
updateSounds():void [static]
Called by the game loop to make sure the sounds get updated each frame. | FlxG |
Method | Defined By | ||
---|---|---|---|
changeSounds():void [static]
An internal function that adjust the volume levels and the music channel after a change. | FlxG | ||
pauseSounds():void [static]
Internal helper, pauses all game sounds. | FlxG | ||
playSounds():void [static]
Internal helper, pauses all game sounds. | FlxG |
_cache | property |
protected static var _cache:Object
Internal storage system to prevent graphics from being used repeatedly in memory.
_game | property |
public static var _game:FlxGame
Internal tracker for game object (so we can pause and unpause)
_mute | property |
protected static var _mute:Boolean
Internal flag for whether or not the game is muted.
_pause | property |
protected static var _pause:Boolean
Internal tracker for game pause state.
_scrollTarget | property |
protected static var _scrollTarget:Point
Internal, used to assist camera and scrolling.
_volume | property |
protected static var _volume:Number
Internal volume level, used for global sound control.
buffer | property |
public static var buffer:BitmapData
Reference to the active graphics buffer.
Can also be referenced via FlxState.screen
.
debug | property |
public static var debug:Boolean
Whether you are running in Debug or Release mode.
Set automatically by FlxFactory
during startup.
elapsed | property |
public static var elapsed:Number
Represents the amount of time in seconds that passed since last frame.
fade | property |
public static var fade:FlxFade
A special effect that fades a color onto the screen. Usage: FlxG.fade.start();
flash | property |
public static var flash:FlxFlash
A special effect that flashes a color on the screen. Usage: FlxG.flash.start();
followLead | property |
public static var followLead:Point
Used to force the camera to look ahead of the followTarget
.
followLerp | property |
public static var followLerp:Number
Used to smoothly track the camera as it follows.
followMax | property |
public static var followMax:Point
Stores the bottom and right edges of the camera area.
followMin | property |
public static var followMin:Point
Stores the top and left edges of the camera area.
followTarget | property |
public static var followTarget:FlxObject
Tells the camera to follow this FlxCore
object around.
framerate | property |
public static var framerate:uint
The desired framerate for the game; default is 60.
frameratePaused | property |
public static var frameratePaused:uint
The desired framerate while paused; default is 10.
height | property |
public static var height:uint
The height of the screen in game pixels.
keys | property |
public static var keys:FlxKeyboard
A reference to a FlxKeyboard
object. Important for input!
kong | property |
public static var kong:FlxKong
Access to the Kongregate high scores and achievements API.
level | property |
public static var level:int
levels | property |
public static var levels:Array
FlxG.levels
and FlxG.scores
are generic
global variables that can be used for various cross-state stuff.
LIBRARY_MAJOR_VERSION | property |
public static var LIBRARY_MAJOR_VERSION:uint = 2
Assign a major version to your library. Appears before the decimal in the console.
LIBRARY_MINOR_VERSION | property |
public static var LIBRARY_MINOR_VERSION:uint = 32
Assign a minor version to your library. Appears after the decimal in the console.
LIBRARY_NAME | property |
public static var LIBRARY_NAME:String = flixel
If you build and maintain your own version of flixel, you can give it your own name here. Appears in the console.
maxElapsed | property |
public static var maxElapsed:Number
Essentially locks the framerate to a minimum value - any slower and you'll get slowdown instead of frameskip; default is 1/30th of a second.
mouse | property |
public static var mouse:FlxMouse
A reference to a FlxMouse
object. Important for input!
music | property |
public static var music:FlxSound
A handy container for a background music object.
mute | property |
mute:Boolean
Set mute
to true to turn off the sound.
The default value is false
.
public static function get mute():Boolean
public static function set mute(value:Boolean):void
panel | property |
public static var panel:FlxPanel
The support panel (twitter, reddit, stumbleupon, paypal, etc) visor thing
pause | property |
pause:Boolean
Set pause
to true to pause the game, all sounds, and display the pause popup.
public static function get pause():Boolean
public static function set pause(value:Boolean):void
quake | property |
public static var quake:FlxQuake
A special effect that shakes the screen. Usage: FlxG.quake.start();
save | property |
public static var save:int
saves | property |
public static var saves:Array
FlxG.saves
is a generic bucket for storing
FlxSaves so you can access them whenever you want.
score | property |
public static var score:int
scores | property |
public static var scores:Array
scroll | property |
public static var scroll:Point
Stores the basic parallax scrolling values.
sounds | property |
public static var sounds:Array
A list of all the sounds being played in the game.
stage | property |
stage:Stage
[read-only] Retrieves the Flash stage object (required for event listeners)
public static function get stage():Stage
state | property |
state:FlxState
Safely access the current game state.
public static function get state():FlxState
public static function set state(value:FlxState):void
timeScale | property |
public static var timeScale:Number
How fast or slow time should pass in the game; default is 1.0.
volume | property |
volume:Number
Set volume
to a number between 0 and 1 to change the global volume.
The default value is 0.5
.
public static function get volume():Number
public static function set volume(value:Number):void
width | property |
public static var width:uint
The width of the screen in game pixels.
workaround | property |
public static var workaround:Bitmap
addBitmap | () | method |
public static function addBitmap(Graphic:Class, Reverse:Boolean = false, Unique:Boolean = false, Key:String = null):BitmapData
Loads a bitmap from a file, caches it, and generates a horizontally flipped version if necessary.
Parameters
Graphic:Class — The image file that you want to load.
| |
Reverse:Boolean (default = false ) — Whether to generate a flipped version.
| |
Unique:Boolean (default = false )
| |
Key:String (default = null )
|
BitmapData — The BitmapData we just created.
|
addLoadedBitmap | () | method |
public static function addLoadedBitmap(Graphic:Bitmap, Reverse:Boolean = false, Unique:Boolean = false):BitmapData
Parameters
Graphic:Bitmap | |
Reverse:Boolean (default = false )
| |
Unique:Boolean (default = false )
|
BitmapData |
changeSounds | () | method |
protected static function changeSounds():void
An internal function that adjust the volume levels and the music channel after a change.
checkBitmapCache | () | method |
public static function checkBitmapCache(Key:String):Boolean
Check the local bitmap cache to see if a bitmap with this key has been loaded already.
Parameters
Key:String — The string key identifying the bitmap.
|
Boolean — Whether or not this file can be found in the cache.
|
createBitmap | () | method |
public static function createBitmap(Width:uint, Height:uint, Color:uint, Unique:Boolean = false, Key:String = null):BitmapData
Generates a new BitmapData
object (a colored square) and caches it.
Parameters
Width:uint — How wide the square should be.
| |
Height:uint — How high the square should be.
| |
Color:uint — What color the square should be (0xAARRGGBB)
| |
Unique:Boolean (default = false )
| |
Key:String (default = null )
|
BitmapData — The BitmapData we just created.
|
createBitmapSimple | () | method |
public static function createBitmapSimple(key:String, Graphic:Bitmap):BitmapData
Parameters
key:String | |
Graphic:Bitmap |
BitmapData |
destroySounds | () | method |
public static function destroySounds(ForceDestroy:Boolean = false):void
Called by FlxGame on state changes to stop and destroy sounds.
Parameters
ForceDestroy:Boolean (default = false ) — Kill sounds even if they're flagged survive .
|
disableDefaultHotKeys | () | method |
public static function disableDefaultHotKeys():void
Disable Fixel's default hot key controls
disablePauseOnFocusLost | () | method |
public static function disablePauseOnFocusLost():void
Disable pausing on focus lost
doFollow | () | method |
public static function doFollow():void
Internal function that updates the camera and parallax scrolling.
enableDefaultHotKeys | () | method |
public static function enableDefaultHotKeys():void
Enable Fixel's default hot key controls
enablePauseOnFocusLost | () | method |
public static function enablePauseOnFocusLost():void
Enable pausing on focus lost
follow | () | method |
public static function follow(Target:FlxObject, Lerp:Number = 1):void
Tells the camera subsystem what FlxCore
object to follow.
Parameters
Target:FlxObject — The object to follow.
| |
Lerp:Number (default = 1 ) — How much lag the camera should have (can help smooth out the camera movement).
|
followAdjust | () | method |
public static function followAdjust(LeadX:Number = 0, LeadY:Number = 0):void
Specify an additional camera component - the velocity-based "lead", or amount the camera should track in front of a sprite.
Parameters
LeadX:Number (default = 0 ) — Percentage of X velocity to add to the camera's motion.
| |
LeadY:Number (default = 0 ) — Percentage of Y velocity to add to the camera's motion.
|
followBounds | () | method |
public static function followBounds(MinX:int = 0, MinY:int = 0, MaxX:int = 0, MaxY:int = 0, UpdateWorldBounds:Boolean = true):void
Specify the boundaries of the level or where the camera is allowed to move.
Parameters
MinX:int (default = 0 ) — The smallest X value of your level (usually 0).
| |
MinY:int (default = 0 ) — The smallest Y value of your level (usually 0).
| |
MaxX:int (default = 0 ) — The largest X value of your level (usually the level width).
| |
MaxY:int (default = 0 ) — The largest Y value of your level (usually the level height).
| |
UpdateWorldBounds:Boolean (default = true ) — Whether the quad tree's dimensions should be updated to match.
|
getMuteValue | () | method |
public static function getMuteValue():uint
Get a number that represents the mute state that we can multiply into a sound transform.
Returnsuint — An unsigned integer - 0 if muted, 1 if not muted.
|
log | () | method |
public static function log(Data:Object):void
Log data to the developer console.
Parameters
Data:Object — Anything you want to log to the console.
|
pauseSounds | () | method |
protected static function pauseSounds():void
Internal helper, pauses all game sounds.
play | () | method |
public static function play(EmbeddedSound:Class, Volume:Number = 1.0, Looped:Boolean = false):FlxSound
Creates a new sound object from an embedded Class
object.
Parameters
EmbeddedSound:Class — The sound you want to play.
| |
Volume:Number (default = 1.0 ) — How loud to play it (0 to 1).
| |
Looped:Boolean (default = false ) — Whether or not to loop this sound.
|
FlxSound — A FlxSound object.
|
playMusic | () | method |
public static function playMusic(Music:Class, Volume:Number = 1.0):void
Set up and play a looping background soundtrack.
Parameters
Music:Class — The sound file you want to loop in the background.
| |
Volume:Number (default = 1.0 ) — How loud the sound should be, from 0 to 1.
|
playSounds | () | method |
protected static function playSounds():void
Internal helper, pauses all game sounds.
resetInput | () | method |
public static function resetInput():void
Reset the input helper objects (useful when changing screens or states)
setGameData | () | method |
public static function setGameData(Game:FlxGame, Width:uint, Height:uint, Zoom:uint):void
Called by FlxGame
to set up FlxG
during FlxGame
's constructor.
Parameters
Game:FlxGame | |
Width:uint | |
Height:uint | |
Zoom:uint |
stream | () | method |
public static function stream(URL:String, Volume:Number = 1.0, Looped:Boolean = false):FlxSound
Creates a new sound object from a URL.
Parameters
URL:String — The sound you want to play.
| |
Volume:Number (default = 1.0 ) — How loud to play it (0 to 1).
| |
Looped:Boolean (default = false ) — Whether or not to loop this sound.
|
FlxSound — A FlxSound object.
|
unfollow | () | method |
public static function unfollow():void
Stops and resets the camera.
updateInput | () | method |
public static function updateInput():void
Calls update on the keyboard and mouse input tracking objects.
updateSounds | () | method |
public static function updateSounds():void
Called by the game loop to make sure the sounds get updated each frame.