Jump to content

Coding style: app or renderer+stage


yahiko
 Share

Recommended Posts

I am wondering what is the recommended coding style for pixi.js applications. Here and there, I can see several possibilities involving a general, centralized PIXI.Application instance or something splitted into a renderer and a stage.

I feel that the second option is a bit old and almost deprecated. Am I wrong?

Link to comment
Share on other sites

Its recommended to have a global object which contains "renderer", "stage", "ticker" and "loader" inside.

If you are lazy like us, just take PIXI.Application, its not like its magic:

https://github.com/pixijs/pixi.js/blob/dev/src/core/Application.js

https://github.com/pixijs/pixi.js/blob/dev/src/loaders/index.js#L46 - there's injection of "loader" into App.

However, depending on your task, you can have multiple renderers with same stage or switch between stages with same renderer.

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