Property | Defined By | ||
---|---|---|---|
![]() | active : Boolean
Controls whether update() is automatically called by FlxState/FlxGroup. | FlxBasic | |
![]() | _ACTIVECOUNT : uint [static] | FlxBasic | |
![]() | alive : Boolean
Useful state for many game objects - "dead" (!alive) vs alive. | FlxBasic | |
alpha : Number | FlxCamera | ||
angle : Number | FlxCamera | ||
antialiasing : Boolean | FlxCamera | ||
bgColor : uint
The natural background color of the camera. | FlxCamera | ||
bounds : FlxRect
The edges of the camera's range, i.e. | FlxCamera | ||
buffer : BitmapData
The actual bitmap data of the camera display itself. | FlxCamera | ||
color : uint | FlxCamera | ||
deadzone : FlxRect
You can assign a "dead zone" to the camera in order to better control its movement. | FlxCamera | ||
defaultZoom : Number [static] | FlxCamera | ||
![]() | exists : Boolean
Controls whether update() and draw() are automatically called by FlxState/FlxGroup. | FlxBasic | |
_flashBitmap : Bitmap
Internal, used to render buffer to screen space. | FlxCamera | ||
height : uint | FlxCamera | ||
![]() | ID : int
IDs seem like they could be pretty useful, huh?
| FlxBasic | |
scroll : FlxPoint
Stores the basic parallax scrolling values. | FlxCamera | ||
target : FlxObject
Tells the camera to follow this FlxObject object around. | FlxCamera | ||
![]() | visible : Boolean
Controls whether draw() is automatically called by FlxState/FlxGroup. | FlxBasic | |
![]() | _VISIBLECOUNT : uint [static] | FlxBasic | |
width : uint | FlxCamera | ||
x : Number | FlxCamera | ||
y : Number | FlxCamera | ||
zoom : Number | FlxCamera |
Property | Defined By | ||
---|---|---|---|
_color : uint
Internal, help with color transforming the flash bitmap. | FlxCamera | ||
_fill : BitmapData | FlxCamera | ||
_flashPoint : Point | FlxCamera | ||
_flashRect : Rectangle | FlxCamera | ||
_fxFadeAlpha : Number | FlxCamera | ||
_fxFadeColor : uint | FlxCamera | ||
_fxFadeComplete : Function | FlxCamera | ||
_fxFadeDuration : Number | FlxCamera | ||
_fxFlashAlpha : Number | FlxCamera | ||
_fxFlashColor : uint | FlxCamera | ||
_fxFlashComplete : Function | FlxCamera | ||
_fxFlashDuration : Number | FlxCamera | ||
_fxShakeComplete : Function | FlxCamera | ||
_fxShakeDirection : uint | FlxCamera | ||
_fxShakeDuration : Number | FlxCamera | ||
_fxShakeIntensity : Number | FlxCamera | ||
_fxShakeOffset : FlxPoint | FlxCamera | ||
_point : FlxPoint
Internal, to help avoid costly allocations. | FlxCamera | ||
_zoom : Number
Indicates how far the camera is zoomed in. | FlxCamera |
Method | Defined By | ||
---|---|---|---|
FlxCamera(X:int, Y:int, Width:int, Height:int, Zoom:Number = 0) | FlxCamera | ||
FlxCamera | |||
destroy():void [override] | FlxCamera | ||
![]() | draw():void
Override this function to control how the object is drawn. | FlxBasic | |
drawFX():void | FlxCamera | ||
fade(Color:uint = 0xffffffff, Duration:Number = 1, OnComplete:Function = null, Force:Boolean = false):void
The screen is gradually filled with this color. | FlxCamera | ||
fill(Color:uint = 0, BlendAlpha:Boolean = true):void | FlxCamera | ||
flash(Color:uint = 0xffffffff, Duration:Number = 1, OnComplete:Function = null, Force:Boolean = false):void
The screen is filled with this color and gradually returns to normal. | FlxCamera | ||
Move the camera focus to this location instantly. | FlxCamera | ||
Tells this camera object what FlxObject to track. | FlxCamera | ||
FlxCamera | |||
![]() | kill():void | FlxBasic | |
![]() | FlxBasic | ||
![]() | postUpdate():void | FlxBasic | |
![]() | preUpdate():void | FlxBasic | |
![]() | revive():void | FlxBasic | |
setBounds(X:Number = 0, Y:Number = 0, Width:Number = 0, Height:Number = 0, UpdateWorld:Boolean = false):void
Specify the boundaries of the level or where the camera is allowed to move. | FlxCamera | ||
setScale(X:Number, Y:Number):void | FlxCamera | ||
shake(Intensity:Number = 0.05, Duration:Number = 0.5, OnComplete:Function = null, Force:Boolean = true, Direction:uint):void
A simple screen-shake effect. | FlxCamera | ||
stopFX():void | FlxCamera | ||
![]() | toString():String
Convert object to readable string name. | FlxBasic | |
update():void [override] | FlxCamera |
Constant | Defined By | ||
---|---|---|---|
SHAKE_BOTH_AXES : uint = 0 [static] | FlxCamera | ||
SHAKE_HORIZONTAL_ONLY : uint = 2 [static] | FlxCamera | ||
SHAKE_VERTICAL_ONLY : uint = 1 [static] | FlxCamera | ||
STYLE_LOCKON : uint = 0 [static] | FlxCamera | ||
STYLE_PLATFORMER : uint = 1 [static] | FlxCamera | ||
STYLE_TOPDOWN : uint = 2 [static] | FlxCamera | ||
STYLE_TOPDOWN_TIGHT : uint = 3 [static] | FlxCamera |
_color | property |
protected var _color:uint
Internal, help with color transforming the flash bitmap.
_fill | property |
protected var _fill:BitmapData
_flashBitmap | property |
public var _flashBitmap:Bitmap
Internal, used to render buffer to screen space.
_flashPoint | property |
protected var _flashPoint:Point
_flashRect | property |
protected var _flashRect:Rectangle
_fxFadeAlpha | property |
protected var _fxFadeAlpha:Number
_fxFadeColor | property |
protected var _fxFadeColor:uint
_fxFadeComplete | property |
protected var _fxFadeComplete:Function
_fxFadeDuration | property |
protected var _fxFadeDuration:Number
_fxFlashAlpha | property |
protected var _fxFlashAlpha:Number
_fxFlashColor | property |
protected var _fxFlashColor:uint
_fxFlashComplete | property |
protected var _fxFlashComplete:Function
_fxFlashDuration | property |
protected var _fxFlashDuration:Number
_fxShakeComplete | property |
protected var _fxShakeComplete:Function
_fxShakeDirection | property |
protected var _fxShakeDirection:uint
_fxShakeDuration | property |
protected var _fxShakeDuration:Number
_fxShakeIntensity | property |
protected var _fxShakeIntensity:Number
_fxShakeOffset | property |
protected var _fxShakeOffset:FlxPoint
_point | property |
protected var _point:FlxPoint
Internal, to help avoid costly allocations.
_zoom | property |
protected var _zoom:Number
Indicates how far the camera is zoomed in.
alpha | property |
alpha:Number
public function get alpha():Number
public function set alpha(value:Number):void
angle | property |
angle:Number
public function get angle():Number
public function set angle(value:Number):void
antialiasing | property |
antialiasing:Boolean
public function get antialiasing():Boolean
public function set antialiasing(value:Boolean):void
bgColor | property |
public var bgColor:uint
The natural background color of the camera. Defaults to FlxG.bgColor. NOTE: can be transparent for crazy FX!
bounds | property |
public var bounds:FlxRect
The edges of the camera's range, i.e. where to stop scrolling.
buffer | property |
public var buffer:BitmapData
The actual bitmap data of the camera display itself.
color | property |
color:uint
public function get color():uint
public function set color(value:uint):void
deadzone | property |
public var deadzone:FlxRect
You can assign a "dead zone" to the camera in order to better control its movement. The camera will always keep the player inside the dead zone.
defaultZoom | property |
public static var defaultZoom:Number
height | property |
public var height:uint
scroll | property |
public var scroll:FlxPoint
Stores the basic parallax scrolling values.
target | property |
public var target:FlxObject
Tells the camera to follow this FlxObject
object around.
width | property |
public var width:uint
x | property |
public var x:Number
y | property |
public var y:Number
zoom | property |
zoom:Number
public function get zoom():Number
public function set zoom(value:Number):void
FlxCamera | () | Constructor |
public function FlxCamera(X:int, Y:int, Width:int, Height:int, Zoom:Number = 0)
X:int | |
Y:int | |
Width:int | |
Height:int | |
Zoom:Number (default = 0 )
|
copyFrom | () | method |
destroy | () | method |
override public function destroy():void
drawFX | () | method |
public function drawFX():void
fade | () | method |
public function fade(Color:uint = 0xffffffff, Duration:Number = 1, OnComplete:Function = null, Force:Boolean = false):void
The screen is gradually filled with this color.
Parameters
Color:uint (default = 0xffffffff ) — The color you want to use.
| |
Duration:Number (default = 1 ) — How long it takes for the fade to finish.
| |
OnComplete:Function (default = null ) — A function you want to run when the fade finishes.
| |
Force:Boolean (default = false ) — Force the effect to reset.
|
fill | () | method |
public function fill(Color:uint = 0, BlendAlpha:Boolean = true):void
Parameters
Color:uint (default = 0 )
| |
BlendAlpha:Boolean (default = true )
|
flash | () | method |
public function flash(Color:uint = 0xffffffff, Duration:Number = 1, OnComplete:Function = null, Force:Boolean = false):void
The screen is filled with this color and gradually returns to normal.
Parameters
Color:uint (default = 0xffffffff ) — The color you want to use.
| |
Duration:Number (default = 1 ) — How long it takes for the flash to fade.
| |
OnComplete:Function (default = null ) — A function you want to run when the flash finishes.
| |
Force:Boolean (default = false ) — Force the effect to reset.
|
focusOn | () | method |
public function focusOn(Point:FlxPoint):void
Move the camera focus to this location instantly.
Parameters
Point:FlxPoint — Where you want the camera to focus.
|
follow | () | method |
public function follow(Target:FlxObject, Style:uint):void
Tells this camera object what FlxObject
to track.
Parameters
Target:FlxObject — The object you want the camera to track. Set to null to not follow anything.
| |
Style:uint (default = NaN ) — How fast to track it (default: 1 - slowish).
|
getScale | () | method |
setBounds | () | method |
public function setBounds(X:Number = 0, Y:Number = 0, Width:Number = 0, Height:Number = 0, UpdateWorld:Boolean = false):void
Specify the boundaries of the level or where the camera is allowed to move.
Parameters
X:Number (default = 0 ) — The smallest X value of your level (usually 0).
| |
Y:Number (default = 0 ) — The smallest Y value of your level (usually 0).
| |
Width:Number (default = 0 ) — The largest X value of your level (usually the level width).
| |
Height:Number (default = 0 ) — The largest Y value of your level (usually the level height).
| |
UpdateWorld:Boolean (default = false ) — Whether the global quad-tree's dimensions should be updated to match (default: false).
|
setScale | () | method |
public function setScale(X:Number, Y:Number):void
Parameters
X:Number | |
Y:Number |
shake | () | method |
public function shake(Intensity:Number = 0.05, Duration:Number = 0.5, OnComplete:Function = null, Force:Boolean = true, Direction:uint):void
A simple screen-shake effect.
Parameters
Intensity:Number (default = 0.05 ) — Percentage of screen size representing the maximum distance that the screen can move while shaking.
| |
Duration:Number (default = 0.5 ) — The length in seconds that the shaking effect should last.
| |
OnComplete:Function (default = null ) — A function you want to run when the shake effect finishes.
| |
Force:Boolean (default = true ) — Force the effect to reset (default = true, unlike flash() and fade()!).
| |
Direction:uint (default = NaN ) — Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY).
|
stopFX | () | method |
public function stopFX():void
update | () | method |
override public function update():void
SHAKE_BOTH_AXES | Constant |
public static const SHAKE_BOTH_AXES:uint = 0
SHAKE_HORIZONTAL_ONLY | Constant |
public static const SHAKE_HORIZONTAL_ONLY:uint = 2
SHAKE_VERTICAL_ONLY | Constant |
public static const SHAKE_VERTICAL_ONLY:uint = 1
STYLE_LOCKON | Constant |
public static const STYLE_LOCKON:uint = 0
STYLE_PLATFORMER | Constant |
public static const STYLE_PLATFORMER:uint = 1
STYLE_TOPDOWN | Constant |
public static const STYLE_TOPDOWN:uint = 2
STYLE_TOPDOWN_TIGHT | Constant |
public static const STYLE_TOPDOWN_TIGHT:uint = 3