-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sprite.ts
43 lines (40 loc) · 1.14 KB
/
Sprite.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
43
namespace Rf.ETS.FrameWork {
/**
* スプライトUI
* @classdesc スプライトUIクラス
* @constructor
* @memberof FrameWork
* @extends enchant.Sprite
*/
export class Sprite extends enchant.Sprite
{
protected fileName: string;
/**
* コンストラクタ
* @method
* @name FrameWork.Sprite#Sprite
* @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);
this.fileName = "";
}
/**
* ファイル名プロパティ
* @method
* @name FrameWork.Sprite#Sprite
* @param {string} value - ファイル名
*/
public set FileName(value:string)
{
if(this.fileName !== value){
this.fileName = value;
this.image = enchant.Core.instance.assets[this.fileName];
}
}
}
}