mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Merge pull request #6569 from Trissolo/refineGameObjectSetTexture
Added two optional parameters to GameObjects.Components.Texture#setTexture
This commit is contained in:
commit
5846acf682
1 changed files with 4 additions and 2 deletions
|
@ -56,14 +56,16 @@ var Texture = {
|
|||
*
|
||||
* @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance.
|
||||
* @param {(string|number)} [frame] - The name or index of the frame within the Texture.
|
||||
* @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?
|
||||
* @param {boolean} [updateOrigin=true] - Should this call change the origin of the Game Object?
|
||||
*
|
||||
* @return {this} This Game Object instance.
|
||||
*/
|
||||
setTexture: function (key, frame)
|
||||
setTexture: function (key, frame, updateSize, updateOrigin)
|
||||
{
|
||||
this.texture = this.scene.sys.textures.get(key);
|
||||
|
||||
return this.setFrame(frame);
|
||||
return this.setFrame(frame, updateSize, updateOrigin);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue