MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / CommentShape

Class CommentShape

src/scripting/api/Display/CommentShape.ts:10–50  ·  view source on GitHub ↗

* Compliant CommentShape Polyfill For BiliScriptEngine

Source from the content-addressed store, hash-verified

8 * Compliant CommentShape Polyfill For BiliScriptEngine
9 */
10 class CommentShape extends Shape implements IComment {
11 private _mM:MotionManager = new MotionManager(this);
12
13 constructor(params:Object) {
14 super();
15 this.setDefaults(params);
16 this.initStyle(params);
17 Runtime.registerObject(this);
18 this.bindParent(params);
19 this._mM.play();
20 }
21
22 get motionManager():MotionManager {
23 return this._mM;
24 }
25
26 set motionManager(m:MotionManager) {
27 __trace("IComment.motionManager is read-only", "warn");
28 }
29
30 private bindParent(params:Object):void {
31 if (params.hasOwnProperty("parent")) {
32 (<DisplayObject> params["parent"]).addChild(this);
33 }
34 }
35
36 public initStyle(style:Object):void {
37 if (typeof style === 'undefined' || style === null) {
38 style = {};
39 }
40 if (style["lifeTime"]) {
41 this._mM.dur = style["lifeTime"] * 1000;
42 }
43 if (style.hasOwnProperty("motionGroup")) {
44 this._mM.initTweenGroup(style["motionGroup"], this._mM.dur);
45 } else if (style.hasOwnProperty("motion")) {
46 this._mM.initTween(style["motion"], false);
47 }
48 }
49
50 }
51
52 export function createShape(params:Object):any {
53 return new CommentShape(params);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected