TextBubble class - chat “bubbles” that appear above characters when they “talk”
1.0
© TheoWorlds.com, 2007--2009.
| com. | TextBubble class - chat “bubbles” that appear above characters when they “talk” |
| Variables | |
| _ID | id of TextBubble |
| _characterID | id of Character |
| _containerMC | just in case. |
| _frameMC | |
| _text | |
| _frameWidth | width of {TextBubble._frameMC} |
| _frameHeight | height of {TextBubble._frameMC} |
| _textPadding | space between the text box and the graphics frame |
| _maxTextWidth | indicates the maximum number of characters |
| _pointerCenterOffset | offset of the pointer from the center |
| _pointerCenterWidth | offset of the pointer from the center |
| _pointerCenterHeight | offset of the pointer from the center |
| _targetMC | container movie clip. |
| _bgColor | |
| _borderColor | |
| _message | |
| emoticonsUrl | |
| baseLineHeight | |
| SMILE_HEIGHT | |
| SMILE_WIDTH | |
| oneLineHeight | |
| textFormat | |
| Functions | |
| TextBubble | Constructor |
| setupEmoticons | |
| setEmoticonText | |
| redraw | when a character reaches the end of the screem the text bubble stays entirely within the screen the bubble pointer keeps pointing at the character |
| draw | draws the text bubble |
| kill | remove text buuble |
| Properties | |
| ID | id |
| characterID | character id |
| containerMC | the bubble movieclip |
| text | the movieclip text |
private var _characterID: Number
id of Character
public function TextBubble( ID: Number, characterID: Number, target: MovieClip, posX: Number, posY: Number, txt: String, initObj: Object )
Constructor
| ID | -- id of TextBubble |
| characterID | -- id of Character |
| target | -- the mc in wich it is created |
| posX | -- x coordinate of a buble relative to the local coordinates of the target movie clip |
| posY | -- y coordinate of a buble relative to the local coordinates of the target movie clip |
| txt | -- text |
| initObj |
private function draw( target : MovieClip, x : Number, y : Number, w : Number, h : Number, r, c, alpha: Number, rot: Number, gradient : String, ratios: Array, //bg borderThickness : Number, borderColor : Number, borderAlpha : Number, pointerWidth: Number, pointerHeight: Number, centerOffset: Number, clearPrevious: Boolean ):Void
draws the text bubble
| target | |
| x | x position of fill |
| y | y position of fill |
| w | width of fill |
| h | height of fill |
| r | corner radius of fill :: number or object {br:#,bl:#,tl:#,tr:#} |
| c | hex color of fill :: number or array [0x######,0x######] |
| alpha | alpha value of fill :: number or array [0x######,0x######] |
| rot | rotation of fill :: number or matrix object {matrixType:”box”,x:#,y:#,w:#,h:#,r:(#*(Math.PI/180))} |
| gradient | type of gradient “linear” or “radial” |
| ratios | (optional :: default [0,255]) -- specifies the distribution of colors :: array [#,#]; |
| borderThickness | |
| borderColor | |
| borderAlpha | |
| pointerWidth | |
| pointerHeight | |
| centerOffset | |
| clearPrevious |
id of TextBubble
private var _ID: Number
id of Character
private var _characterID: Number
just in case.
private var _containerMC: MovieClip
private var _frameMC: MovieClip
private var _text: TextField
width of {TextBubble._frameMC}
private var _frameWidth: Number
height of {TextBubble._frameMC}
private var _frameHeight: Number
space between the text box and the graphics frame
private static var _textPadding: Number
indicates the maximum number of characters
private static var _maxTextWidth: Number
offset of the pointer from the center
private static var _pointerCenterOffset: Number
offset of the pointer from the center
private static var _pointerCenterWidth: Number
offset of the pointer from the center
private static var _pointerCenterHeight: Number
container movie clip.
private var _targetMC: MovieClip
private var _bgColor: Number
private var _borderColor: Number
private var _message: String
private static var emoticonsUrl: Array
private static var baseLineHeight: Number
private static var SMILE_HEIGHT: Number
private static var SMILE_WIDTH: Number
private static var oneLineHeight: Number
private static var textFormat: TextFormat
Constructor
public function TextBubble( ID: Number, characterID: Number, target: MovieClip, posX: Number, posY: Number, txt: String, initObj: Object )
public static function setupEmoticons():Void
private function setEmoticonText( ID: Number, characterID: Number, target: MovieClip, posX: Number, posY: Number, txt: String, initObj: Object ):Void
when a character reaches the end of the screem the text bubble stays entirely within the screen the bubble pointer keeps pointing at the character
public function redraw( deltaX: Number, deltaY: Number ):Void
draws the text bubble
private function draw( target : MovieClip, x : Number, y : Number, w : Number, h : Number, r, c, alpha: Number, rot: Number, gradient : String, ratios: Array, //bg borderThickness : Number, borderColor : Number, borderAlpha : Number, pointerWidth: Number, pointerHeight: Number, centerOffset: Number, clearPrevious: Boolean ):Void
remove text buuble
public function kill():Void
id
public function get ID():Number
character id
public function get characterID():Number
the bubble movieclip
public function get containerMC():MovieClip
the movieclip text
public function get text():String