Jump to content

A few simple questions


hexdecks
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!  :)

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