File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { AssetBase } from './base';
5
5
import type { MonoScript } from './monoScript' ;
6
6
import { PPtr } from './pptr' ;
7
7
import type { Texture2D } from './texture2d' ;
8
- import type { ObjectInfo } from './types' ;
8
+ import type { ImgBitMap , ObjectInfo } from './types' ;
9
9
import { AssetType } from './types' ;
10
10
11
11
class AtlasInfo {
@@ -28,6 +28,16 @@ class AtlasInfo {
28
28
if ( ! img ) return ;
29
29
return getJimpPNG ( img ) ;
30
30
}
31
+
32
+ getImageBitmap ( ) : ImgBitMap | undefined {
33
+ const bitmap = this . getImageJimp ( ) ?. bitmap ;
34
+ if ( ! bitmap ) return ;
35
+ return {
36
+ data : bitmap . data . buffer as unknown as ArrayBuffer ,
37
+ width : bitmap . width ,
38
+ height : bitmap . height ,
39
+ } ;
40
+ }
31
41
}
32
42
33
43
class AtlasSprite {
@@ -50,6 +60,16 @@ class AtlasSprite {
50
60
if ( ! img ) return ;
51
61
return getJimpPNG ( img ) ;
52
62
}
63
+
64
+ getImageBitmap ( ) : ImgBitMap | undefined {
65
+ const bitmap = this . getImageJimp ( ) ?. bitmap ;
66
+ if ( ! bitmap ) return ;
67
+ return {
68
+ data : bitmap . data . buffer as unknown as ArrayBuffer ,
69
+ width : bitmap . width ,
70
+ height : bitmap . height ,
71
+ } ;
72
+ }
53
73
}
54
74
55
75
export class MonoBehaviour extends AssetBase {
@@ -97,3 +117,5 @@ export class MonoBehaviour extends AssetBase {
97
117
}
98
118
}
99
119
}
120
+
121
+ export { AtlasInfo as MonoBehaviourAtlasInfo , AtlasSprite as MonoBehaviourAtlasSprite } ;
You can’t perform that action at this time.
0 commit comments