Jump to content

Pixi override method with typescript


Recommended Posts


I want to use Container's method in my typescript class. How can i do this? Like this:

public addChild( child:PIXI.Container ):PIXI.Container 

			child.x = 0;
			child.y = -(child.height / 2);
			var holder:PIXI.Container = new PIXI.Container();
			this._itemDictionary[ child.name ] = holder;
			super.addChild( holder );
			holder.addChild( child );
			holder.alpha = 0;
			return child;


Link to comment
Share on other sites

Ok I've handled it. Thank you.

public addChild(...child:PIXI.DisplayObject[]): PIXI.DisplayObject {
        child[0].x = 0;
        child[0].y = -((child[0] as PIXI.Container).height / 2);

        var holder: PIXI.Container = new PIXI.Container();
        this._itemDictionary[child[0].name] = holder;

        holder.alpha = 0;

        return child[0];


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...