* Compliant CommentField Polyfill For BiliScriptEngine
| 8 | * Compliant CommentField Polyfill For BiliScriptEngine |
| 9 | */ |
| 10 | class CommentField extends TextField implements IComment { |
| 11 | private _mM:MotionManager = new MotionManager(this); |
| 12 | |
| 13 | constructor(text:string, params:Object = {}) { |
| 14 | super(text, 0xffffff); |
| 15 | this.setDefaults(params); |
| 16 | this.initStyle(params); |
| 17 | Runtime.registerObject(this); |
| 18 | this.bindParent(params); |
| 19 | this._mM.play(); |
| 20 | } |
| 21 | |
| 22 | set fontsize(size:number) { |
| 23 | var tf = this.getTextFormat(); |
| 24 | tf.size = size; |
| 25 | this.setTextFormat(tf); |
| 26 | } |
| 27 | |
| 28 | get fontsize():number { |
| 29 | return this.getTextFormat().fontsize; |
| 30 | } |
| 31 | |
| 32 | set font(fontname:string) { |
| 33 | var tf = this.getTextFormat(); |
| 34 | tf.font = fontname; |
| 35 | this.setTextFormat(tf); |
| 36 | } |
| 37 | |
| 38 | get font():string { |
| 39 | return this.getTextFormat().font; |
| 40 | } |
| 41 | |
| 42 | set align(a:string) { |
| 43 | var tf = this.getTextFormat(); |
| 44 | tf.align = a; |
| 45 | this.setTextFormat(tf); |
| 46 | } |
| 47 | |
| 48 | get align():string { |
| 49 | return this.getTextFormat().align; |
| 50 | } |
| 51 | |
| 52 | set bold(b:boolean) { |
| 53 | var tf = this.getTextFormat(); |
| 54 | tf.bold = b; |
| 55 | this.setTextFormat(tf); |
| 56 | } |
| 57 | |
| 58 | get bold():boolean { |
| 59 | return this.getTextFormat().bold; |
| 60 | } |
| 61 | |
| 62 | get motionManager():MotionManager { |
| 63 | return this._mM; |
| 64 | } |
| 65 | |
| 66 | set motionManager(m:MotionManager) { |
| 67 | __trace("IComment.motionManager is read-only", "warn"); |
nothing calls this directly
no outgoing calls
no test coverage detected