Packageorg.rapidphysics
Classpublic class RapidText
InheritanceRapidText Inheritance RapidObject Inheritance RapidBasic Inheritance Object

This class is a careful rip and downgrade of FlxText. I just needed an easy way to throw text into this engine.



Public Properties
 PropertyDefined By
 Inheritedacceleration : Point
Mess with this in your update loop
RapidObject
 Inheritedactive : Boolean
RapidBasic
  alignment : String
[read-only] The alignment of the font ("left", "right", or "center").
RapidText
 Inheritedcenter : Point
Relative to (x,y)
RapidObject
 Inheritedexists : Boolean
RapidBasic
 InheritedfillColor : uint
RapidObject
 Inheritedfixed : Boolean = false
Set to true to prevent this object from moving
RapidObject
  font : String
[read-only] The font used for this text.
RapidText
 Inheritedheight : Number
Depending on the shape, height can totally be negative!
RapidObject
 InheritedlineColor : uint
0xRRGGBB
RapidObject
 InheritedmaxVelocity : Point
RapidObject
 InheritednextPosition : Point
RapidObject
 InheritednextVelocity : Point
RapidObject
 InheritednextX : Number
RapidObject
 InheritednextY : Number
RapidObject
 Inheritedposition : Point
RapidObject
 InheritedpredictMotionFunction : Function
I wrote some code to allow dynamic changes between Euler integration and Verlet integration.
RapidObject
 InheritedprevX : Number
RapidObject
 InheritedprevY : Number
RapidObject
 Inheritedradians : Number
RapidObject
 Inheritedshape : Shape
RapidObject
  size : Number
[read-only] The size of the text being displayed.
RapidText
  text : String
The text being displayed.
RapidText
  textField : TextField
[read-only]
RapidText
 Inheritedthickness : Number = 1
RapidObject
 Inheritedvelocity : Point
Mess with this in your update loop
RapidObject
 Inheritedvisible : Boolean
RapidBasic
 Inheritedwidth : Number
Depending on the shape, width can totally be negative!
RapidObject
 Inheritedx : Number
RapidObject
 Inheritedy : Number
RapidObject
Protected Properties
 PropertyDefined By
 Inheritedalpha : Number
RapidObject
 Inherited_point : Point
General usage
RapidObject
  _textField : TextField
Internal reference to a Flash TextField object.
RapidText
Public Methods
 MethodDefined By
  
RapidText(X:Number, Y:Number, Width:uint, Text:String = null, EmbeddedFont:Boolean = true)
Creates a new FlxText object at the specified position.
RapidText
 Inherited
debugDraw():void
[override]
RapidObject
  
destroy():void
[override] Clean up memory.
RapidText
 Inherited
draw():void
[override]
RapidObject
 Inherited
postUpdate():void
[override] Predicts where this object will be by the next preUpdate() Provides enough information to draw physics information, and resolve collisions
RapidObject
 Inherited
preDraw():void
[override]
RapidObject
 Inherited
preUpdate():void
[override] Occurs right after collision resolution Set x to nextX, etc etc
RapidObject
 Inherited
reset(X:Number, Y:Number):void
RapidObject
  
setFormat(Font:String = null, Size:Number = 12, Color:uint = 0xffffff, Alignment:String = null):RapidText
You can use this if you have a lot of text parameters to set instead of the individual properties.
RapidText
 Inherited
setIntegrationMethod(method:Number):void
takes RapidG.INTEGRATION_EULER, etc.
RapidObject
 Inherited
update():void
[override] Add your game's update logic here
RapidObject
Protected Methods
 MethodDefined By
 Inherited
RapidObject
 Inherited
RapidObject
 Inherited
Override this function if your shape has a different center
RapidObject
 Inherited
RapidObject
Property Detail
_textFieldproperty
protected var _textField:TextField

Internal reference to a Flash TextField object.

alignmentproperty 
alignment:String  [read-only]

The alignment of the font ("left", "right", or "center").


Implementation
    public function get alignment():String
fontproperty 
font:String  [read-only]

The font used for this text.


Implementation
    public function get font():String
sizeproperty 
size:Number  [read-only]

The size of the text being displayed.


Implementation
    public function get size():Number
textproperty 
text:String

The text being displayed.


Implementation
    public function get text():String
    public function set text(value:String):void
textFieldproperty 
textField:TextField  [read-only]


Implementation
    public function get textField():TextField
Constructor Detail
RapidText()Constructor
public function RapidText(X:Number, Y:Number, Width:uint, Text:String = null, EmbeddedFont:Boolean = true)

Creates a new FlxText object at the specified position.

Parameters
X:Number — The X position of the text.
 
Y:Number — The Y position of the text.
 
Width:uint — The width of the text object (height is determined automatically).
 
Text:String (default = null) — The actual text you would like to display initially.
 
EmbeddedFont:Boolean (default = true) — Whether this text field uses embedded fonts or nto
Method Detail
destroy()method
override public function destroy():void

Clean up memory.

setFormat()method 
public function setFormat(Font:String = null, Size:Number = 12, Color:uint = 0xffffff, Alignment:String = null):RapidText

You can use this if you have a lot of text parameters to set instead of the individual properties.

Parameters

Font:String (default = null) — The name of the font face for the text display.
 
Size:Number (default = 12) — The size of the font (in pixels essentially).
 
Color:uint (default = 0xffffff) — The color of the text in traditional flash 0xRRGGBB format.
 
Alignment:String (default = null) — A string representing the desired alignment ("left,"right" or "center").

Returns
RapidText — This FlxText instance (nice for chaining stuff together, if you're into that).