11import * as PIXI from "pixi.js" ;
2+
23import { Rectangle } from "./Rectangle" ;
34import { Stage } from "./Stage" ;
45
5-
6- // TODO : document the class?
7-
8- /**
9- * The basic object that rpresents an image.
10- *
11- * @class Bitmap
12- */
136declare class Bitmap {
147
15- /**
16- * The base texture that holds the image.
17- *
18- * @type {PIXI.BaseTexture }
19- * @memberof Bitmap
20- */
21-
8+ constructor ( width : number , height : number ) ;
229
10+ public readonly url : string ;
2311 public readonly baseTexture : PIXI . BaseTexture ;
24-
25- /**
26- * The bitmap canvas.
27- *
28- * @type {HTMLCanvasElement }
29- * @memberof Bitmap
30- */
12+ public readonly image : HTMLImageElement ;
3113 public readonly canvas : HTMLCanvasElement ;
32-
33- /**
34- * The 2d context of the bitmap canvas.
35- *
36- * @type {CanvasRenderingContext2D }
37- * @memberof Bitmap
38- */
3914 public readonly context : CanvasRenderingContext2D ;
4015
41- public fontBold : boolean ;
16+ public readonly width : number ;
17+ public readonly height : number ;
18+ public readonly rect : Rectangle
4219
43- public fontFace : string ;
20+ public smooth : boolean ;
4421
45- public fontItalic : boolean ;
22+ public paintOpacity : number ;
4623
24+ public fontFace : string ;
4725 public fontSize : number ;
26+ public fontBold : boolean ;
27+ public fontItalic : boolean ;
4828
49- public readonly image : HTMLImageElement ;
29+ public textColor : string ;
5030
5131 public outlineColor : string ;
52-
5332 public outlineWidth : number ;
5433
55- public paintOpacity : number ;
56-
57- public readonly rect : Rectangle
58-
59- public smooth : boolean ;
60-
61- public textColor : string ;
62-
63- public readonly url : string ;
64-
65- public readonly width : number ;
66-
67- public readonly height : number ;
68-
69- /**
70- * Creates an instance of Bitmap.
71- * @param {number } width The width of the bitmap.
72- * @param {number } height The height of the bitmap.
73- * @memberof Bitmap
74- */
75- constructor ( width : number , height : number ) ;
76-
7734 public static load ( url : string ) : Bitmap ;
78-
7935 public static snap ( stage : Stage ) : Bitmap ;
8036
81- // eslint-disable-next-line @typescript-eslint/ban-types
82- public addLoadListener ( listner : Function ) : void ;
37+ public isError ( ) : boolean ;
38+ public isReady ( ) : boolean ;
8339
84- public blt ( source : Bitmap , sx : number , sy : number , sw : number , sh : number , dx : number , dy : number , dw : number , dh : number ) : void ;
40+ public retry ( ) : void ;
8541
86- public clear ( ) : void ;
42+ public addLoadListener ( listener : ( self : Bitmap ) => void ) : void ;
8743
44+ public blt ( source : Bitmap , sx : number , sy : number , sw : number , sh : number , dx : number , dy : number , dw : number , dh : number ) : void ;
45+
46+ public clear ( ) : void ;
8847 public clearRect ( x : number , y : number , width : number , height : number ) : void ;
8948
9049 public destroy ( ) : void ;
9150
9251 public drawCircle ( x : number , y : number , radius : number , color : number ) : void ;
93-
94- public drawText ( text : string | number , x : number , y : number , maxWidth : number , lineHeight :number , align : string ) : void ;
52+ public drawText ( text : string | number , x : number , y : number , maxWidth : number , lineHeight :number , align : string ) : void ;
9553
9654 public fillAll ( color : string ) : void ;
55+ public fillRect ( x : number , y :number , width : number , height : number , color : string ) : void ;
56+ public gradientFillRect ( x : number , y : number , width : number , height : number , color1 : string , color2 : string , vertical : boolean ) : void ;
9757
98- public fillRect ( x : number , y :number , width : number , height : number , color : string ) : void ;
99-
10058 public getAlphaPixel ( x :number , y : number ) : string ;
101-
10259 public getPixel ( x : number , y : number ) : string ;
10360
104- public gradientFillRect ( x : number , y : number , width : number , height : number , color1 : string , color2 : string , vertical : boolean ) : void ;
105-
106- public isError ( ) : boolean ;
107-
108- public isReady ( ) : boolean ;
109-
110- public measureTextwidth ( text : string ) : number ;
111-
112- public retry ( ) : void ;
61+ public measureTextWidth ( text : string ) : number ;
11362
11463 public strokeRect ( x : number , y : number , width : number , height : number , color : string ) : void ;
11564
116- public resize ( width : number , height : number )
65+ public resize ( width : number , height : number ) : void ;
66+
11767}
11868
119- export { Bitmap }
69+ export { Bitmap } ;
0 commit comments