Jump to content

How to manual render game object without using stage?


hnim
 Share

Recommended Posts

Because Pixi Application renders Stage just after update and it hides your bunny. Look in this article: https://github.com/pixijs/pixi.js/wiki/v5-Custom-Application-GameLoop , everything except "interactionManager" part is true. In your case, you'll have problem with interaction anyway.

As for rendering single elements step-by-step, @finscn is an expert on that. One of his threads: https://github.com/pixijs/pixi.js/issues/4369. Just search by his name in issues and you'll see enough material to understand that trick. However, i also recommend to read "Application" "WebGLRenderer" and "Container" class sources.

 

Link to comment
Share on other sites

Thanks for your reply. Here is my next try

1. instead of adding bunny into stage, i use a empty container:

// create a containter to add bunny
var dummyContainer = new PIXI.Container();
// add bunny
dummyContainer.addChild(bunny);

2. in update function, i call updateTransform and render manual

// manual update and render
  bunny.updateTransform();
  bunny.renderWebGL(app.renderer);

Here is full source code: https://jsfiddle.net/7k9znhwy/21/

It is ok with WebGL, but i still have same problem if application use Canvas render. Do you have any idea about this?

 

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