API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class FlxPanel

Package | org.flixel.data
Class | public class FlxPanel
Inheritance | FlxPanel FlxObject FlxRect FlxPoint

This is a little built-in support visor that developers can optionally display. It has built in support for syndicating your game to StumbleUpon, Digg, Reddit, Del.icio.us, and Twitter. It also has a PayPal donate button. This panel is automatically created by `FlxGame` and you can toggle the visibility via `FlxG`.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | acceleration : FlxPoint How fast the speed of this object is changing. | FlxObject
|  | active : Boolean If an object is not alive, the game loop will not automatically call `update()` on it. | FlxObject
|  | angle : Number Set the angle of a sprite to rotate it. | FlxObject
|  | angularAcceleration : Number How fast the spin speed should change. | FlxObject
|  | angularDrag : Number Like `drag` but for spinning. | FlxObject
|  | angularVelocity : Number This is how fast you want this sprite to spin. | FlxObject
|  | bottom : Number The Y coordinate of the bottom of the rectangle. | FlxRect
|  | colHullX : FlxRect These store a couple of useful numbers for speeding up collision resolution. | FlxObject
|  | colHullY : FlxRect These store a couple of useful numbers for speeding up collision resolution. | FlxObject
|  | collideBottom : Boolean Flag for direction collision resolution. | FlxObject
|  | collideLeft : Boolean Flag for direction collision resolution. | FlxObject
|  | collideRight : Boolean Flag for direction collision resolution. | FlxObject
|  | collideTop : Boolean Flag for direction collision resolution. | FlxObject
|  | colOffsets : Array An array of `FlxPoint` objects. | FlxObject
|  | colVector : FlxPoint These store a couple of useful numbers for speeding up collision resolution. | FlxObject
|  | dead : Boolean Handy for tracking gameplay or animations. | FlxObject
|  | drag : FlxPoint This isn't drag exactly, more like deceleration that is only applied when acceleration is not affecting the sprite. | FlxObject
|  | exists : Boolean Kind of a global on/off switch for any objects descended from `FlxObject`. | FlxObject
|  | fixed : Boolean If an object is 'fixed' in space, it will not budge when it collides with a not-fixed object. | FlxObject
|  | _group : Boolean Dedicated internal flag for whether or not this class is a FlxGroup. | FlxObject
|  | health : Number Handy for storing health percentage or armor points or whatever. | FlxObject
|  | height : Number | FlxRect
|  | left : Number The X coordinate of the left side of the rectangle. | FlxRect
|  | maxAngular : Number Use in conjunction with `angularAcceleration` for fluid spin speed control. | FlxObject
|  | maxThrust : Number Used to cap `thrust`, helpful and easy! | FlxObject
|  | maxVelocity : FlxPoint If you are using `acceleration`, you can use `maxVelocity` with it to cap the speed automatically (very useful!). | FlxObject
|  | moves : Boolean Set this to false if you want to skip the automatic motion/movement stuff (see `updateMotion()`). | FlxObject
|  | onFloor : Boolean Flag that indicates whether or not you just hit the floor. | FlxObject
|  | origin : FlxPoint WARNING: The origin of the sprite will default to its center. | FlxObject
|  | right : Number The X coordinate of the right side of the rectangle. | FlxRect
|  | scrollFactor : FlxPoint A point that can store numbers from 0 to 1 (for X and Y independently) that governs how much this object is affected by the camera subsystem. | FlxObject
|  | solid : Boolean If an object is dead, the functions that automate collisions will skip it (see `FlxG.overlapArrays()` and `FlxG.collideArrays()`). | FlxObject
|  | thrust : Number If you want to do Asteroids style stuff, check out thrust, instead of directly accessing the object's velocity or acceleration. | FlxObject
|  | top : Number The Y coordinate of the top of the rectangle. | FlxRect
|  | velocity : FlxPoint The basic speed of this object. | FlxObject
|  | visible : Boolean If an object is not visible, the game loop will not automatically call `render()` on it. | FlxObject
|  | width : Number | FlxRect
|  | x : Number | FlxPoint
|  | y : Number | FlxPoint

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined by
--- | --- | ---
|  | _flashPoint : Point This is a pre-allocated Flash Point object, which is useful for certain Flash graphics API calls | FlxObject
|  | _flicker : Boolean Internal helper used for retro-style flickering. | FlxObject
|  | _flickerTimer : Number Internal helper used for retro-style flickering. | FlxObject
|  | _point : FlxPoint This is just a pre-allocated x-y point container to be used however you like | FlxObject
|  | _rect : FlxRect This is just a pre-allocated rectangle container to be used however you like | FlxObject

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | FlxPanel() Constructor. | FlxPanel
|  | collide(Object:FlxObject = null):Boolean If you don't want to call `FlxU.collide()` you can use this instead. | FlxObject
|  | destroy():void Called by `FlxGroup`, commonly when game states are changed. | FlxObject
|  | flicker(Duration:Number = 1):void Tells this object to flicker, retro-style. | FlxObject
|  | flickering():Boolean Check to see if the object is still flickering. | FlxObject
|  | getScreenXY(Point:FlxPoint = null):FlxPoint Call this function to figure out the on-screen position of the object. | FlxObject
|  | hide():void Hide the support panel. | FlxPanel
|  | hitBottom(Contact:FlxObject, Velocity:Number):void Called when this object's bottom edge collides with the top of another `FlxObject`. | FlxObject
|  | hitLeft(Contact:FlxObject, Velocity:Number):void Called when this object's left side collides with another `FlxObject`'s right. | FlxObject
|  | hitRight(Contact:FlxObject, Velocity:Number):void Called when this object's right side collides with another `FlxObject`'s left. | FlxObject
|  | hitTop(Contact:FlxObject, Velocity:Number):void Called when this object's top collides with the bottom of another `FlxObject`. | FlxObject
|  | hurt(Damage:Number):void Call this function to "damage" (or give health bonus) to this sprite. | FlxObject
|  | kill():void Call this function to "kill" a sprite so that it no longer 'exists'. | FlxObject
|  | onClose():void Called when the player presses the Close button. | FlxPanel
|  | onDelicious():void Called when the player presses the del.icio.us button. | FlxPanel
|  | onDigg():void Called when the player presses the Digg button. | FlxPanel
|  | onDonate():void Called when the player presses the Donate button. | FlxPanel
|  | onReddit():void Called when the player presses the Reddit button. | FlxPanel
|  | onScreen():Boolean Check and see if this object is currently on screen. | FlxObject
|  | onStumble():void Called when the player presses the StumbleUpon button. | FlxPanel
|  | onTwitter():void Called when the player presses the Twitter button. | FlxPanel
|  | overlaps(Object:FlxObject):Boolean Checks to see if some `FlxObject` object overlaps this `FlxObject` object. | FlxObject
|  | overlapsPoint(X:Number, Y:Number, PerPixel:Boolean = false):Boolean Checks to see if a point in 2D space overlaps this `FlxObject` object. | FlxObject
|  | preCollide(Object:FlxObject):void `FlxU.collide()` (and thus `FlxObject.collide()`) call this function each time two objects are compared to see if they collide. | FlxObject
|  | refreshHulls():void Called by `FlxObject.updateMotion()` and some constructors to rebuild the basic collision data for this object. | FlxObject
|  | render():void Actually draws the bar to the screen. | FlxPanel
|  | reset(X:Number, Y:Number):void Handy function for reviving game objects. | FlxObject
|  | setup(PayPalID:String, PayPalAmount:Number, GameTitle:String, GameURL:String, Caption:String):void Set up the support panel with donation and aggregation info. | FlxPanel
|  | show(Top:Boolean = true):void Show the support panel. | FlxPanel
|  | toString():String Convert object to readable string name. | FlxPoint
|  | update():void Updates and animates the panel. | FlxPanel

Protected Methods
Hide Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined by
--- | --- | ---
|  | updateFlickering():void Just updates the retro-style flickering. | FlxObject
|  | updateMotion():void Internal function for updating the position and speed of this object. | FlxObject

Protected Constants
Hide Inherited Protected Constants
Show Inherited Protected Constants

| Constant | Defined by
--- | --- | ---
|  | _pZero : FlxPoint [static] A handy "empty point" object | FlxObject

Constructor detail

FlxPanel | () | constructor

`public function FlxPanel()`

Constructor.

Method detail

hide | () | method

`public function hide():void`

Hide the support panel.

onClose | () | method |

`public function onClose():void`

Called when the player presses the Close button.

onDelicious | () | method |

`public function onDelicious():void`

Called when the player presses the del.icio.us button.

onDigg | () | method |

`public function onDigg():void`

Called when the player presses the Digg button.

onDonate | () | method |

`public function onDonate():void`

Called when the player presses the Donate button.

onReddit | () | method |

`public function onReddit():void`

Called when the player presses the Reddit button.

onStumble | () | method |

`public function onStumble():void`

Called when the player presses the StumbleUpon button.

onTwitter | () | method |

`public function onTwitter():void`

Called when the player presses the Twitter button.

render | () | method |

`public override function render():void`

Actually draws the bar to the screen.

setup | () | method |

`public function setup(PayPalID:String, PayPalAmount:Number, GameTitle:String, GameURL:String, Caption:String):void`

Set up the support panel with donation and aggregation info. Like `show()` and `hide()` this function is usually called through `FlxGame` or `FlxG`, not directly.

Parameters

| `PayPalID:String` — Your paypal username, usually your email address (leave it blank to disable donations).
| `PayPalAmount:Number` — The default amount of the donation.
| `GameTitle:String` — The text that you would like to appear in the aggregation services (usually just the name of your game).
| `GameURL:String` — The URL you would like people to use when trying to find your game.
| `Caption:String`

show | () | method |

`public function show(Top:Boolean = true):void`

Show the support panel.

Parameters

| `Top:Boolean` (default = `true`)`` — Whether the visor should appear at the top or bottom of the screen.

update | () | method |

`public override function update():void`

Updates and animates the panel.