@@ -33,6 +33,10 @@ namespace gdjs {
3333 export type SpriteFrameData = {
3434 /** The resource name of the image used in this frame. */
3535 image : string ;
36+ /** The spritesheet resource name (if using a spritesheet frame instead of an image). */
37+ spritesheetName ?: string ;
38+ /** The frame name within the spritesheet (if using a spritesheet frame instead of an image). */
39+ spritesheetFrameName ?: string ;
3640 /** The points of the frame. */
3741 points : Array < SpriteCustomPointData > ;
3842 /** The origin point. */
@@ -79,7 +83,11 @@ namespace gdjs {
7983 * Abstraction from graphic libraries texture classes.
8084 */
8185 export interface AnimationFrameTextureManager < T > {
82- getAnimationFrameTexture ( imageName : string ) : T ;
86+ getAnimationFrameTexture (
87+ imageName : string ,
88+ spritesheetName ?: string ,
89+ spritesheetFrameName ?: string
90+ ) : T ;
8391 getAnimationFrameWidth ( pixiTexture : T ) ;
8492 getAnimationFrameHeight ( pixiTexture : T ) ;
8593 }
@@ -110,7 +118,11 @@ namespace gdjs {
110118 textureManager : gdjs . AnimationFrameTextureManager < T >
111119 ) {
112120 this . image = frameData ? frameData . image : '' ;
113- this . texture = textureManager . getAnimationFrameTexture ( this . image ) ;
121+ this . texture = textureManager . getAnimationFrameTexture (
122+ this . image ,
123+ frameData ?. spritesheetName ,
124+ frameData ?. spritesheetFrameName
125+ ) ;
114126 this . points = new Hashtable ( ) ;
115127 this . reinitialize ( frameData , textureManager ) ;
116128 }
@@ -124,7 +136,11 @@ namespace gdjs {
124136 textureManager : gdjs . AnimationFrameTextureManager < T >
125137 ) {
126138 this . image = frameData . image ;
127- this . texture = textureManager . getAnimationFrameTexture ( this . image ) ;
139+ this . texture = textureManager . getAnimationFrameTexture (
140+ this . image ,
141+ frameData . spritesheetName ,
142+ frameData . spritesheetFrameName
143+ ) ;
128144
129145 this . points . clear ( ) ;
130146 for ( let i = 0 , len = frameData . points . length ; i < len ; ++ i ) {
0 commit comments