Jump to content

Add polygon to container


fire7side
 Share

Recommended Posts

I can't seem to add a polygon to a stage.  Probably something simple.  I made just a square to see if I messed it up, but same thing.  When I comment out the addChild line for the poly it works.  When I uncomment it says: 

Uncaught TypeError: t.emit is not a function

 

var scn4 = {
getStage:function(){
	this.name = "Scene";
	this.polyPts = [0,0,0,100,100,100,100,0];
	this.poly = new PIXI.Polygon(this.polyPts);
	this.stage = new PIXI.Container();
	//
	this.bg = new PIXI.Sprite(
	PIXI.loader.resources["assets/img/dogRoom.jpg"].texture
    );	
	this.test = new PIXI.Sprite(
	PIXI.loader.resources["assets/img/test.jpg"].texture
    ); 
    this.stage.addChild(this.bg);
	this.stage.addChild(this.test);
	//this.stage.addChild(this.poly);
    return this.stage;
}
}

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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