Sign in to follow this  
jh13

Help understanding Application.renderer

Recommended Posts

I need some direction on something I am a little unclear about.

In my hello-world Pixi.js app I create a basic Graphics object, draw a polygon, and add it to the stage.

I then call Application.renderer.render(myApp.stage) to render what I have just drawn.

But, even with just this one call to render, how is the screen updated via events like Graphics.mouseover?

For example:

region.mouseover = function(){
    region.tint = 0x000;
}

Even though I have no game loop to redraw this Graphics object, triggering this event that updates the tint will update the graphics object on the screen.

My assumption is that internally Pixi.js has a separate "layer" for tinting and just redraws automatically when the tint is updated.

Any clarification on this would be fantastic, I just want to be throughout in my understanding.

Thank you!

Share this post


Link to post
Share on other sites

PixiJS Application class is for hello-worldies. I congratulate you! You passed to the next step - you have to create your own app and gameloop: https://github.com/pixijs/pixi.js/wiki/v5-Custom-Application-GameLoop

I hope that article explains everything. Well, except interaction. Interaction currently is inside Renderer as a plugin, `renderer.plugins.interaction` and i dont know if it runs on app ticker or pixi shader ticker or pixi global ticker (yeah, there are THREE tickers)

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.