Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3980

How to extends PIXI.extras.AnimatedSprite?

$
0
0

how can I extends the AnimatedSprite from pixi 4.8.7?

I'm not able to do this in vscode because it says that the constructor of base class (AnimatedSprite) should be 0 args but got 2. Why this?

Se my code:

import 'pixi.js';

export class Animation extends PIXI.extras.AnimatedSprite
{
	constructor (name:string, textures:PIXI.Texture[], loop:boolean=true)
	{
		super(textures,loop);
		this.name = name;
		this.anchor.set(0.5);
	}
}

I'm using typescript. At the line with the super give error in vscode, and the this.name and anchor it like if not exist.

What should I do?


Viewing all articles
Browse latest Browse all 3980