Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Container } from '@pixi/display';
/**
* To be overridden by the subclass
* @method _renderCanvas
* @memberof PIXI.Container#
* @protected
* @param {PIXI.CanvasRenderer} renderer - The renderer
*/
Container.prototype._renderCanvas = function _renderCanvas(renderer) // eslint-disable-line no-unused-vars
{
// this is where content itself gets rendered...
};
/**
* Renders the object using the Canvas renderer
* @method renderCanvas
* @memberof PIXI.Container#
* @param {PIXI.CanvasRenderer} renderer - The renderer
*/
Container.prototype.renderCanvas = function renderCanvas(renderer)
{
// if not visible or the alpha is 0 then no need to render this
if (!this.visible || this.worldAlpha <= 0 || !this.renderable)
{
return;
* @memberof PIXI.Container#
* @protected
* @param {PIXI.CanvasRenderer} renderer - The renderer
*/
Container.prototype._renderCanvas = function _renderCanvas(renderer) // eslint-disable-line no-unused-vars
{
// this is where content itself gets rendered...
};
/**
* Renders the object using the Canvas renderer
* @method renderCanvas
* @memberof PIXI.Container#
* @param {PIXI.CanvasRenderer} renderer - The renderer
*/
Container.prototype.renderCanvas = function renderCanvas(renderer)
{
// if not visible or the alpha is 0 then no need to render this
if (!this.visible || this.worldAlpha <= 0 || !this.renderable)
{
return;
}
if (this._mask)
{
renderer.maskManager.pushMask(this._mask);
}
this._renderCanvas(renderer);
for (let i = 0, j = this.children.length; i < j; ++i)
{
this.children[i].renderCanvas(renderer);
* The instance name of the object.
*
* @memberof PIXI.DisplayObject#
* @member {string} name
*/
DisplayObject.prototype.name = null;
/**
* Returns the display object in the container.
*
* @method getChildByName
* @memberof PIXI.Container#
* @param {string} name - Instance name.
* @return {PIXI.DisplayObject} The child with the specified name.
*/
Container.prototype.getChildByName = function getChildByName(name)
{
for (let i = 0; i < this.children.length; i++)
{
if (this.children[i].name === name)
{
return this.children[i];
}
}
return null;
};