Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: allow render function in RenderContainer to be overridable #10196

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

GoodBoyDigital
Copy link
Member

allow devs to either provide a render function or override it by extending the class:

import { RenderContainer } from 'pixi.js';

// extend the class
class MyRenderContainer extends RenderContainer
{
   render(renderer)
   {
     renderer.clear({
        clearColor: 'green', // clear the screen to green when rendering this item
     });
  }
}

// override the render method
const renderContainer = new RenderContainer(
(renderer) =>  {
    renderer.clear({
      clearColor: 'green', // clear the screen to green when rendering this item
    });
});

Copy link

codesandbox-ci bot commented Feb 7, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7ad516a:

Sandbox Source
pixi.js-sandbox Configuration

@Zyie Zyie changed the title v8 Tweak render container to be overridable Fix: allow render function in RenderContainer to be overridable Feb 8, 2024
@Zyie Zyie merged commit 58aad64 into next-v8 Feb 8, 2024
4 checks passed
@Zyie Zyie deleted the chore/render-container-tweak branch February 8, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants