-
Notifications
You must be signed in to change notification settings - Fork 0
/
NoImageSprite.ts
42 lines (40 loc) · 1.29 KB
/
NoImageSprite.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
namespace Rf.ETS.FrameWork {
/**
* イメージ無しスプライトUI
* @classdesc イメージ無しスプライトUIクラス
* @constructor
* @memberof FrameWork
* @extends enchant.Sprite
*/
export class NoImageSprite extends enchant.Sprite
{
/**
* コンストラクタ
* @method
* @name FrameWork.NoImageSprite#NoImageSprite
* @param {number} width - 表示サイズ.幅
* @param {number} height - 表示サイズ.高さ
* @param {Object} parent - 親Group
*/
public constructor(width: number, height: number, parent: enchant.Group)
{
super(width,height);
parent.addChild(this);
}
/**
* 塗りつぶし情報の設定
* @method
* @name FrameWork.NoImageSprite#SetSurface
* @param {string} fillStyle - 塗りつぶし情報
*/
public SetSurface(fillStyle: string): void
{
let rfView = new enchant.Surface(this.width , this.height);
rfView.context.beginPath();
rfView.context.fillStyle = fillStyle;
rfView.context.rect(0, 0, this.width, this.height);
rfView.context.fill();
this.image = rfView;
}
}
}