File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,6 +177,35 @@ var Texture = new Class({
177177 return frame ;
178178 } ,
179179
180+ /**
181+ * Removes the given Frame from this Texture. The Frame is destroyed immediately.
182+ *
183+ * Any Game Objects using this Frame should stop using it _before_ you remove it,
184+ * as it does not happen automatically.
185+ *
186+ * @method Phaser.Textures.Texture#remove
187+ * @since 3.19.0
188+ *
189+ * @param {string } name - The key of the Frame to remove.
190+ *
191+ * @return {boolean } True if a Frame with the matching key was removed from this Texture.
192+ */
193+ remove : function ( name )
194+ {
195+ if ( this . has ( name ) )
196+ {
197+ var frame = this . get ( name ) ;
198+
199+ frame . destroy ( ) ;
200+
201+ delete this . frames [ name ] ;
202+
203+ return true ;
204+ }
205+
206+ return false ;
207+ } ,
208+
180209 /**
181210 * Checks to see if a Frame matching the given key exists within this Texture.
182211 *
You can’t perform that action at this time.
0 commit comments