Skip to content

Commit 26421bd

Browse files
committed
Removed Graphics.setTexture and related commands as no longer supported
1 parent f85eca1 commit 26421bd

5 files changed

Lines changed: 6 additions & 68 deletions

File tree

src/gameobjects/graphics/Commands.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ module.exports = {
2323
TRANSLATE: 16,
2424
SCALE: 17,
2525
ROTATE: 18,
26-
SET_TEXTURE: 19,
27-
CLEAR_TEXTURE: 20,
2826
GRADIENT_FILL_STYLE: 21,
2927
GRADIENT_LINE_STYLE: 22
3028

src/gameobjects/graphics/Graphics.js

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -368,62 +368,6 @@ var Graphics = new Class({
368368
return this;
369369
},
370370

371-
/**
372-
* Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this.
373-
*
374-
* Textures are referenced by their string-based keys, as stored in the Texture Manager.
375-
*
376-
* Once set, all shapes will use this texture. Call this method with no arguments to clear it.
377-
*
378-
* The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason,
379-
* it works best with seamless / tileable textures.
380-
*
381-
* The mode argument controls how the textures are combined with the fill colors. The default value (0) will
382-
* multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture,
383-
* and a value of 2 will use just the texture and no fill color at all.
384-
*
385-
* @method Phaser.GameObjects.Graphics#setTexture
386-
* @since 3.12.0
387-
* @webglOnly
388-
*
389-
* @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.
390-
* @param {(string|integer)} [frame] - The name or index of the frame within the Texture.
391-
* @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only.
392-
*
393-
* @return {this} This Game Object.
394-
*/
395-
setTexture: function (key, frame, mode)
396-
{
397-
if (mode === undefined) { mode = 0; }
398-
399-
if (key === undefined)
400-
{
401-
this.commandBuffer.push(
402-
Commands.CLEAR_TEXTURE
403-
);
404-
}
405-
else
406-
{
407-
var textureFrame = this.scene.sys.textures.getFrame(key, frame);
408-
409-
if (textureFrame)
410-
{
411-
if (mode === 2)
412-
{
413-
mode = 3;
414-
}
415-
416-
this.commandBuffer.push(
417-
Commands.SET_TEXTURE,
418-
textureFrame,
419-
mode
420-
);
421-
}
422-
}
423-
424-
return this;
425-
},
426-
427371
/**
428372
* Start a new shape path.
429373
*

src/gameobjects/graphics/GraphicsCanvasRenderer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, rend
229229
case Commands.GRADIENT_LINE_STYLE:
230230
index += 6;
231231
break;
232-
233-
case Commands.SET_TEXTURE:
234-
index += 2;
235-
break;
236232
}
237233
}
238234

src/gameobjects/graphics/typedefs/Options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Options for the Graphics game Object.
2+
* Options for the Graphics Game Object.
33
*
44
* @typedef {object} Phaser.Types.GameObjects.Graphics.Options
55
* @extends Phaser.Types.GameObjects.Graphics.Styles
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* @typedef {object} Phaser.Types.GameObjects.Graphics.RoundedRectRadius
33
* @since 3.11.0
4-
*
5-
* @property {number} [tl=20] - Top left
6-
* @property {number} [tr=20] - Top right
7-
* @property {number} [br=20] - Bottom right
8-
* @property {number} [bl=20] - Bottom left
4+
*
5+
* @property {number} [tl=20] - Top left corner radius.
6+
* @property {number} [tr=20] - Top right corner radius.
7+
* @property {number} [br=20] - Bottom right corner radius.
8+
* @property {number} [bl=20] - Bottom left corner radius.
99
*/

0 commit comments

Comments
 (0)