hexdecks Posted January 8, 2015 Share Posted January 8, 2015 Hello All, Hope you are all well and settling into 2015 I've just started working with Pixi. I have a few questions before I start to get an understanding of things: What is the difference between the use of PIXI.Graphics and PIXI.Polygon? Can both be used to render to the screen? (.Graphics using Canvas-like lineTo & moveTo methods, whereas .Polygon takes vertices?)Is it necessary to have a displayObjectContainer in order to render interactive graphics? What is the purpose / benefit of it?Does Box2D play nicely with Pixi for use with collision tests on complex 2D polygons?Thanks in advance!Jordan Quote Link to comment Share on other sites More sharing options...
achexi Posted January 9, 2015 Share Posted January 9, 2015 It is not necessary to have a DisplayObjectContainer, however the stage itself is one. It's necessary to add objects to the stage in order for them to be rendered.There are a few benefits to using containers, in my case I mostly use them to manage each screen for a game. (Loading/start/main game screens etc.) You can then add them all to your stage and filter through the visible property on them to change which one you want to show. I also tend to put these screens inside a parent container so that objects inside can all be scaled/resolution can be changed. I haven't tried Box2D with PIXI but it should work fine. As for PIXI graphics + polygon. I don't believe polygon renders to screen, I think it simply draws the shape which can then be used for things such as render to texture/collision etc. However I may be wrong on this one. But graphics will render to screen so you may want to just go with that. Quote Link to comment Share on other sites More sharing options...
hexdecks Posted January 9, 2015 Author Share Posted January 9, 2015 It is not necessary to have a DisplayObjectContainer, however the stage itself is one. It's necessary to add objects to the stage in order for them to be rendered.There are a few benefits to using containers, in my case I mostly use them to manage each screen for a game. (Loading/start/main game screens etc.) You can then add them all to your stage and filter through the visible property on them to change which one you want to show. I also tend to put these screens inside a parent container so that objects inside can all be scaled/resolution can be changed. I haven't tried Box2D with PIXI but it should work fine. As for PIXI graphics + polygon. I don't believe polygon renders to screen, I think it simply draws the shape which can then be used for things such as render to texture/collision etc. However I may be wrong on this one. But graphics will render to screen so you may want to just go with that. Really useful response - thank you.I'm in the process of building a simple isometric game engine. I'll let you know of my progress! Quote Link to comment Share on other sites More sharing options...
achexi Posted January 9, 2015 Share Posted January 9, 2015 No problem! Keep us up to date. There are quite a lot of isometric games/projects that people have posted on this forum done using pixi. It could be pretty beneficial for you to look around for some of those posts. 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.