diff --git a/src/extras/TextureTransform.js b/src/extras/TextureTransform.js index 5957709..88648b6 100644 --- a/src/extras/TextureTransform.js +++ b/src/extras/TextureTransform.js @@ -28,7 +28,6 @@ * Changes frame clamping * Works with TilingSprite and Mesh * Change to 1.5 if you tex ture has repeated right and bottom lines, that leads to smoother borders - * IN REAL PIXELS * * @default 0 * @member {number} @@ -38,8 +37,7 @@ /** * Changes frame clamping * Works with TilingSprite and Mesh - * Change to 0 to add a pixel to the edge, recommended for transparent trimmed textures in atlas - * IN REAL PIXELS + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas * * @default 0.5 * @member {number} diff --git a/src/extras/TextureTransform.js b/src/extras/TextureTransform.js index 5957709..88648b6 100644 --- a/src/extras/TextureTransform.js +++ b/src/extras/TextureTransform.js @@ -28,7 +28,6 @@ * Changes frame clamping * Works with TilingSprite and Mesh * Change to 1.5 if you tex ture has repeated right and bottom lines, that leads to smoother borders - * IN REAL PIXELS * * @default 0 * @member {number} @@ -38,8 +37,7 @@ /** * Changes frame clamping * Works with TilingSprite and Mesh - * Change to 0 to add a pixel to the edge, recommended for transparent trimmed textures in atlas - * IN REAL PIXELS + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas * * @default 0.5 * @member {number} diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index c1aba40..af69ffa 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -62,15 +62,27 @@ */ this.uvTransform = texture.transform || new TextureTransform(texture); } + /** + * Changes frame clamping in corresponding textureTransform, shortcut + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas + * + * @default 0.5 + * @member {number} + * @memberof PIXI.TilingSprite + */ + get clampMargin() + { + return this.uvTransform.clampMargin; + } /** - * setter for clampEdge + * setter for clampMargin * * @param {number} value assigned value */ - set clampEdge(value) + set clampMargin(value) { - this.uvTransform.clampEdge = value; + this.uvTransform.clampMargin = value; this.uvTransform.update(true); } @@ -146,7 +158,7 @@ this.tileTransform.updateLocalTransform(); this.uvTransform.update(); - renderer.setObjectRenderer(renderer.plugins.tiling); + renderer.setObjectRenderer(renderer.plugins.tilingSprite); renderer.plugins.tilingSprite.render(this); } @@ -231,8 +243,8 @@ /** * Gets the local bounds of the sprite object. * - * @param {Rectangle} rect - The output rectangle. - * @return {Rectangle} The bounds. + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. */ getLocalBounds(rect) { @@ -248,7 +260,7 @@ { if (!this._localBoundsRect) { - this._localBoundsRect = new Rectangle(); + this._localBoundsRect = new core.Rectangle(); } rect = this._localBoundsRect; diff --git a/src/extras/TextureTransform.js b/src/extras/TextureTransform.js index 5957709..88648b6 100644 --- a/src/extras/TextureTransform.js +++ b/src/extras/TextureTransform.js @@ -28,7 +28,6 @@ * Changes frame clamping * Works with TilingSprite and Mesh * Change to 1.5 if you tex ture has repeated right and bottom lines, that leads to smoother borders - * IN REAL PIXELS * * @default 0 * @member {number} @@ -38,8 +37,7 @@ /** * Changes frame clamping * Works with TilingSprite and Mesh - * Change to 0 to add a pixel to the edge, recommended for transparent trimmed textures in atlas - * IN REAL PIXELS + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas * * @default 0.5 * @member {number} diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index c1aba40..af69ffa 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -62,15 +62,27 @@ */ this.uvTransform = texture.transform || new TextureTransform(texture); } + /** + * Changes frame clamping in corresponding textureTransform, shortcut + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas + * + * @default 0.5 + * @member {number} + * @memberof PIXI.TilingSprite + */ + get clampMargin() + { + return this.uvTransform.clampMargin; + } /** - * setter for clampEdge + * setter for clampMargin * * @param {number} value assigned value */ - set clampEdge(value) + set clampMargin(value) { - this.uvTransform.clampEdge = value; + this.uvTransform.clampMargin = value; this.uvTransform.update(true); } @@ -146,7 +158,7 @@ this.tileTransform.updateLocalTransform(); this.uvTransform.update(); - renderer.setObjectRenderer(renderer.plugins.tiling); + renderer.setObjectRenderer(renderer.plugins.tilingSprite); renderer.plugins.tilingSprite.render(this); } @@ -231,8 +243,8 @@ /** * Gets the local bounds of the sprite object. * - * @param {Rectangle} rect - The output rectangle. - * @return {Rectangle} The bounds. + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. */ getLocalBounds(rect) { @@ -248,7 +260,7 @@ { if (!this._localBoundsRect) { - this._localBoundsRect = new Rectangle(); + this._localBoundsRect = new core.Rectangle(); } rect = this._localBoundsRect; diff --git a/src/extras/webgl/TilingSpriteRenderer.js b/src/extras/webgl/TilingSpriteRenderer.js index 3fadc8f..b74d861 100644 --- a/src/extras/webgl/TilingSpriteRenderer.js +++ b/src/extras/webgl/TilingSpriteRenderer.js @@ -9,7 +9,7 @@ /** * WebGL renderer plugin for tiling sprites */ -export class TilingRenderer extends core.ObjectRenderer { +export class TilingSpriteRenderer extends core.ObjectRenderer { /** * constructor for renderer @@ -143,4 +143,4 @@ } } -core.WebGLRenderer.registerPlugin('tilingSprite', TilingRenderer); +core.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);