Package | stencyl.api.engine.gui |
Class | public class Label |
Inheritance | Label ![]() ![]() ![]() ![]() ![]() |
Implements | Component |
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 | |
![]() | alpha : Number
Set alpha to a number between 0 and 1 to change the opacity of the sprite. | FlxSprite | |
![]() | 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 | |
![]() | _animations : Array | FlxSprite | |
![]() | antialiasing : Boolean
Controls whether the object is smoothed when rotated, affects performance. | FlxSprite | |
![]() | blend : String
Blending modes, just like Photoshop!
E.g. | FlxSprite | |
![]() | bottom : Number [read-only]
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 | |
![]() | color : uint
Set color to a number in this format: 0xRRGGBB. | FlxSprite | |
![]() | 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 | |
![]() | facing : uint
Set facing using FlxSprite.LEFT,RIGHT,
UP, and DOWN to take advantage of
flipped sprites and/or just track player orientation more easily. | FlxSprite | |
![]() | filter : * | FlxSprite | |
![]() | finished : Boolean
Whether the current animation has finished its first (or only) loop. | FlxSprite | |
![]() | fixed : Boolean
If an object is 'fixed' in space, it will not budge when it collides with a not-fixed object. | FlxObject | |
font : Font | Label | ||
![]() | frame : uint
Tell the sprite to change to a specific frame of animation. | FlxSprite | |
![]() | frameHeight : uint
The height of the actual graphic or image being displayed (not necessarily the game object/bounding box). | FlxSprite | |
![]() | _framePixels : BitmapData | FlxSprite | |
![]() | frameWidth : uint
The width of the actual graphic or image being displayed (not necessarily the game object/bounding box). | FlxSprite | |
game : GameState | Label | ||
![]() | _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 [read-only]
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 | |
_numDisplayChars : int | Label | ||
numDisplayChars : int | Label | ||
![]() | offset : FlxPoint
If you changed the size of your sprite object to shrink the bounding box,
you might need to offset the new bounding box from the top-left corner of the sprite. | FlxSprite | |
![]() | 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 | |
parent : Panel | Label | ||
![]() | pixels : BitmapData
Set pixels to any BitmapData object. | FlxSprite | |
![]() | realFrameCount : int | FlxSprite | |
![]() | right : Number [read-only]
The X coordinate of the right side of the rectangle. | FlxRect | |
![]() | scale : FlxPoint
Change the size of your sprite's graphic. | FlxSprite | |
![]() | 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 | |
text : String | Label | ||
![]() | 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 [read-only]
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 |
Property | Defined By | ||
---|---|---|---|
_alignment : String
The text alignment
| Label | ||
![]() | _alpha : Number | FlxSprite | |
![]() | _bakedRotation : Number | FlxSprite | |
![]() | _caf : uint | FlxSprite | |
![]() | _callback : Function | FlxSprite | |
![]() | _color : uint | FlxSprite | |
![]() | _ct : ColorTransform | FlxSprite | |
_cTransform : ColorTransform
This is used to change the color of the bitmap
| Label | ||
![]() | _curAnim : FlxAnim | FlxSprite | |
![]() | _curFrame : uint | FlxSprite | |
![]() | _facing : uint | FlxSprite | |
![]() | _flashPoint : Point
This is a pre-allocated Flash Point object, which is useful for certain Flash graphics API calls
| FlxObject | |
![]() | _flashPointZero : Point | FlxSprite | |
![]() | _flashRect : Rectangle | FlxSprite | |
![]() | _flashRect2 : Rectangle | FlxSprite | |
![]() | _flicker : Boolean
Internal helper used for retro-style flickering. | FlxObject | |
![]() | _flickerTimer : Number
Internal helper used for retro-style flickering. | FlxObject | |
![]() | _flipped : uint | FlxSprite | |
![]() | _frameTimer : Number | FlxSprite | |
_frect : Rectangle
The bounding box of the internal bitmap
| Label | ||
![]() | _mtx : Matrix | FlxSprite | |
_p : Point
The coordinates to which several things are copied
| Label | ||
![]() | _pixels : BitmapData | FlxSprite | |
![]() | _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 |
Method | Defined By | ||
---|---|---|---|
Label | |||
![]() | addAnimation(Name:String, Frames:Array, FrameRate:Number = 0, Looped:Boolean = true):void
Adds a new animation to the sprite. | FlxSprite | |
![]() | addAnimationCallback(AnimationCallback:Function):void
Pass in a function to be called whenever this sprite's animation changes. | FlxSprite | |
animateNumDisplayCharsTo(endValue:int, duration:int, startDelay:int):void | Label | ||
![]() | applyFilter(filter:*):void | FlxSprite | |
![]() | FlxObject | ||
![]() | createGraphic(Width:uint, Height:uint, Color:uint = 0xffffffff, Unique:Boolean = false, Key:String = null):FlxSprite
This function creates a flat colored square image dynamically. | FlxSprite | |
![]() | destroy():void
Called by FlxGroup, commonly when game states are changed. | FlxObject | |
![]() |
This function draws or stamps one FlxSprite onto another. | FlxSprite | |
fadeTo(value:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
![]() | fill(Color:uint):void
Fills this sprite's graphic with a specific color. | FlxSprite | |
![]() | 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 | |
getAngle():Number | Label | ||
getHeight():Number | Label | ||
getNumDisplayChars():int | Label | ||
getOpacity():Number | Label | ||
Label | |||
getParentX():Number | Label | ||
getParentY():Number | Label | ||
![]() | [override]
Call this function to figure out the on-screen position of the object. | FlxSprite | |
getText():String | Label | ||
getWidth():Number | Label | ||
getX():Number | Label | ||
getY():Number | Label | ||
growTo(scaleX:Number = 1, scaleY:Number = 1, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
![]() |
Called when this object's bottom edge collides with the top of another FlxObject. | FlxObject | |
![]() |
Called when this object's left side collides with another FlxObject's right. | FlxObject | |
![]() |
Called when this object's right side collides with another FlxObject's left. | FlxObject | |
![]() |
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 | |
isVisible():Boolean | Label | ||
![]() | kill():void
Call this function to "kill" a sprite so that it no longer 'exists'. | FlxObject | |
![]() | loadExtGraphic(Graphic:Bitmap, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false, Key:String = null):FlxSprite | FlxSprite | |
![]() | loadGraphic(Graphic:Class, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false):FlxSprite
Load an image from an embedded graphic file. | FlxSprite | |
![]() | loadRotatedGraphic(Graphic:Class, Rotations:uint = 16, Frame:int = -1, AntiAliasing:Boolean = false, AutoBuffer:Boolean = false):FlxSprite
Create a pre-rotated sprite sheet from a simple sprite. | FlxSprite | |
moveBy(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
moveTo(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
![]() | onEmit():void
Triggered whenever this sprite is launched by a FlxEmitter. | FlxSprite | |
![]() | onScreen():Boolean
Check and see if this object is currently on screen. | FlxObject | |
![]() |
Checks to see if some FlxObject object overlaps this FlxObject object. | FlxObject | |
![]() | overlapsPoint(X:Number, Y:Number, PerPixel:Boolean = false):Boolean [override]
Checks to see if a point in 2D space overlaps this FlxCore object. | FlxSprite | |
![]() | play(AnimName:String, Force:Boolean = false):void
Plays an existing animation (e.g. | FlxSprite | |
![]() | playFromFrame(StartFrame:int = 0):void
Plays the current Animation from a specific frame
| FlxSprite | |
![]() | 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 | |
![]() | randomFrame():void
Tell the sprite to change to a random frame of animation
Useful for instantiating particles or other weird things. | FlxSprite | |
![]() | refreshHulls():void
Called by FlxObject.updateMotion() and some constructors to
rebuild the basic collision data for this object. | FlxObject | |
![]() | removeFilter(filter:*):void
Call this function to remove one (or more) filters from the sprite
| FlxSprite | |
![]() | removeFirstFilter():void
Call this function to remove the last filter that was applied
| FlxSprite | |
![]() | removeLastFilter():void
Call this function to remove the last filter that was applied
| FlxSprite | |
![]() | render():void [override]
Called by game loop, updates then blits or renders current frame of animation to the screen
| FlxSprite | |
![]() | reset(X:Number, Y:Number):void
Handy function for reviving game objects. | FlxObject | |
![]() | setFilter(filter:*):void
Call this function to add a filter to the sprite
| FlxSprite | |
Label | |||
setNumDisplayChars(n:int):void | Label | ||
setOpacity(o:Number):void | Label | ||
setParentPanel(p:Panel):void | Label | ||
setText(text:String):void | Label | ||
setVisible(isVisible:Boolean):void | Label | ||
spinBy(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
spinTo(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Label | ||
![]() | toString():String
Convert object to readable string name. | FlxPoint | |
![]() | unsafeBind(Pixels:BitmapData):void
Internal function, currently only used to quickly update FlxState.screen for post-processing. | FlxSprite | |
![]() | update():void [override]
Main game loop update function. | FlxSprite | |
![]() | updateAnimation():void
Internal function for updating the sprite's animation. | FlxSprite |
Method | Defined By | ||
---|---|---|---|
calcFrame():void [override]
Updates the internal bitmap. | Label | ||
renderSprite():void [override] | Label | ||
![]() | resetHelpers():void
Resets some important variables for sprite optimization and rendering. | FlxSprite | |
![]() | updateFlickering():void
Just updates the retro-style flickering. | FlxObject | |
![]() | updateMotion():void
Internal function for updating the position and speed of this object. | FlxObject |
_alignment | property |
protected var _alignment:String
The text alignment
_cTransform | property |
protected var _cTransform:ColorTransform
This is used to change the color of the bitmap
_frect | property |
protected var _frect:Rectangle
The bounding box of the internal bitmap
_numDisplayChars | property |
public var _numDisplayChars:int
_p | property |
protected var _p:Point
The coordinates to which several things are copied
font | property |
public var font:Font
game | property |
public var game:GameState
numDisplayChars | property |
numDisplayChars:int
public function get numDisplayChars():int
public function set numDisplayChars(value:int):void
parent | property |
public var parent:Panel
text | property |
public var text:String
Label | () | Constructor |
public function Label(font:Font, text:String, x:int, y:int)
font:Font | |
text:String | |
x:int | |
y:int |
animateNumDisplayCharsTo | () | method |
public function animateNumDisplayCharsTo(endValue:int, duration:int, startDelay:int):void
Parameters
endValue:int | |
duration:int | |
startDelay:int |
calcFrame | () | method |
override protected function calcFrame():void
Updates the internal bitmap.
fadeTo | () | method |
public function fadeTo(value:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
value:Number | |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|
getAngle | () | method |
public function getAngle():Number
ReturnsNumber |
getHeight | () | method |
public function getHeight():Number
ReturnsNumber |
getNumDisplayChars | () | method |
public function getNumDisplayChars():int
Returnsint |
getOpacity | () | method |
public function getOpacity():Number
ReturnsNumber |
getParentPanel | () | method |
getParentX | () | method |
public function getParentX():Number
ReturnsNumber |
getParentY | () | method |
public function getParentY():Number
ReturnsNumber |
getText | () | method |
public function getText():String
ReturnsString |
getWidth | () | method |
public function getWidth():Number
ReturnsNumber |
getX | () | method |
public function getX():Number
ReturnsNumber |
getY | () | method |
public function getY():Number
ReturnsNumber |
growTo | () | method |
public function growTo(scaleX:Number = 1, scaleY:Number = 1, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
scaleX:Number (default = 1 )
| |
scaleY:Number (default = 1 )
| |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|
isVisible | () | method |
public function isVisible():Boolean
ReturnsBoolean |
moveBy | () | method |
public function moveBy(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
x:Number | |
y:Number | |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|
moveTo | () | method |
public function moveTo(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
x:Number | |
y:Number | |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|
renderSprite | () | method |
override protected function renderSprite():void
setFont | () | method |
setNumDisplayChars | () | method |
public function setNumDisplayChars(n:int):void
Parameters
n:int |
setOpacity | () | method |
public function setOpacity(o:Number):void
Parameters
o:Number |
setParentPanel | () | method |
setText | () | method |
public function setText(text:String):void
Parameters
text:String |
setVisible | () | method |
public function setVisible(isVisible:Boolean):void
Parameters
isVisible:Boolean |
spinBy | () | method |
public function spinBy(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
angle:Number | |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|
spinTo | () | method |
public function spinTo(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void
Parameters
angle:Number | |
duration:int (default = 1000 )
| |
easing:String (default = linear )
| |
delay:int (default = 0 )
|