ddennis Posted November 30, 2013 Share Posted November 30, 2013 Hi First of all thanks for a great engine. This should be very basic,I would expect that i could make a circle or a rectangle like this:var circle = new PIXI.Circle(10,10,50)stage.addChild(circle)) but that throws the following error:Uncaught TypeError: Cannot set property '_iPrev' of undefined pixi.js:1324 PIXI.DisplayObjectContainer.addChildpixi.js:1324 (anonymous function)index.html:36 Uncaught TypeError: Cannot read property '_iNext' of undefined pixi.js:5712 PIXI.WebGLRenderGroup.addDisplayObjectAndChildrenpixi.js:5712 PIXI.WebGLRenderGroup.setRenderablepixi.js:5282 PIXI.WebGLRenderer.renderpixi.js:4441 animate The only way that works for me is like this, which seem like a work around.var g = new PIXI.Graphics()g.beginFill(0xFFCC00, 1)g.drawCircle(100,100,50)stage.addChild(g) If everything works as intended i am missing a comment/hint in the code that they shoud not be instantiated directly. Thanks again for a great engine./Dennis Quote Link to comment Share on other sites More sharing options...
xerver Posted November 30, 2013 Share Posted November 30, 2013 Geometries are not renderable, they are for doing geometric calculations. The "workaround" you posted is the proper way to draw a primitive circle. Quote Link to comment Share on other sites More sharing options...
ddennis Posted December 1, 2013 Author Share Posted December 1, 2013 Ok - thanks. Quote Link to comment Share on other sites More sharing options...
ddennis Posted December 17, 2013 Author Share Posted December 17, 2013 Hi I just did a simple abstraction, so it's easy to use.It is not interactive, so you need a rendertexture to use mouse events. https://github.com/ddennis/PIXI-Utils-and-canvas-utils/tree/master/src/ddennis/display/shapes If anyone else has ported some AS3 please share. /Dennis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.