File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { AssetBase } from './base';
55import type { MonoScript } from './monoScript' ;
66import { PPtr } from './pptr' ;
77import type { Texture2D } from './texture2d' ;
8- import type { ObjectInfo } from './types' ;
8+ import type { ImgBitMap , ObjectInfo } from './types' ;
99import { AssetType } from './types' ;
1010
1111class AtlasInfo {
@@ -28,6 +28,16 @@ class AtlasInfo {
2828 if ( ! img ) return ;
2929 return getJimpPNG ( img ) ;
3030 }
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+ }
3141}
3242
3343class AtlasSprite {
@@ -50,6 +60,16 @@ class AtlasSprite {
5060 if ( ! img ) return ;
5161 return getJimpPNG ( img ) ;
5262 }
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+ }
5373}
5474
5575export class MonoBehaviour extends AssetBase {
@@ -97,3 +117,5 @@ export class MonoBehaviour extends AssetBase {
97117 }
98118 }
99119}
120+
121+ export { AtlasInfo as MonoBehaviourAtlasInfo , AtlasSprite as MonoBehaviourAtlasSprite } ;
You can’t perform that action at this time.
0 commit comments