mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Removed Graphics.setTexture
and related commands as no longer supported
This commit is contained in:
parent
f85eca14ac
commit
26421bde82
5 changed files with 6 additions and 68 deletions
|
@ -23,8 +23,6 @@ module.exports = {
|
|||
TRANSLATE: 16,
|
||||
SCALE: 17,
|
||||
ROTATE: 18,
|
||||
SET_TEXTURE: 19,
|
||||
CLEAR_TEXTURE: 20,
|
||||
GRADIENT_FILL_STYLE: 21,
|
||||
GRADIENT_LINE_STYLE: 22
|
||||
|
||||
|
|
|
@ -368,62 +368,6 @@ var Graphics = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this.
|
||||
*
|
||||
* Textures are referenced by their string-based keys, as stored in the Texture Manager.
|
||||
*
|
||||
* Once set, all shapes will use this texture. Call this method with no arguments to clear it.
|
||||
*
|
||||
* The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason,
|
||||
* it works best with seamless / tileable textures.
|
||||
*
|
||||
* The mode argument controls how the textures are combined with the fill colors. The default value (0) will
|
||||
* multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture,
|
||||
* and a value of 2 will use just the texture and no fill color at all.
|
||||
*
|
||||
* @method Phaser.GameObjects.Graphics#setTexture
|
||||
* @since 3.12.0
|
||||
* @webglOnly
|
||||
*
|
||||
* @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture.
|
||||
* @param {(string|integer)} [frame] - The name or index of the frame within the Texture.
|
||||
* @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setTexture: function (key, frame, mode)
|
||||
{
|
||||
if (mode === undefined) { mode = 0; }
|
||||
|
||||
if (key === undefined)
|
||||
{
|
||||
this.commandBuffer.push(
|
||||
Commands.CLEAR_TEXTURE
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var textureFrame = this.scene.sys.textures.getFrame(key, frame);
|
||||
|
||||
if (textureFrame)
|
||||
{
|
||||
if (mode === 2)
|
||||
{
|
||||
mode = 3;
|
||||
}
|
||||
|
||||
this.commandBuffer.push(
|
||||
Commands.SET_TEXTURE,
|
||||
textureFrame,
|
||||
mode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Start a new shape path.
|
||||
*
|
||||
|
|
|
@ -229,10 +229,6 @@ var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, rend
|
|||
case Commands.GRADIENT_LINE_STYLE:
|
||||
index += 6;
|
||||
break;
|
||||
|
||||
case Commands.SET_TEXTURE:
|
||||
index += 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Options for the Graphics game Object.
|
||||
* Options for the Graphics Game Object.
|
||||
*
|
||||
* @typedef {object} Phaser.Types.GameObjects.Graphics.Options
|
||||
* @extends Phaser.Types.GameObjects.Graphics.Styles
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* @typedef {object} Phaser.Types.GameObjects.Graphics.RoundedRectRadius
|
||||
* @since 3.11.0
|
||||
*
|
||||
* @property {number} [tl=20] - Top left
|
||||
* @property {number} [tr=20] - Top right
|
||||
* @property {number} [br=20] - Bottom right
|
||||
* @property {number} [bl=20] - Bottom left
|
||||
* @property {number} [tl=20] - Top left corner radius.
|
||||
* @property {number} [tr=20] - Top right corner radius.
|
||||
* @property {number} [br=20] - Bottom right corner radius.
|
||||
* @property {number} [bl=20] - Bottom left corner radius.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue