-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Talk about renderChildren
again.
#4369
Comments
Extract standalone `renderChildren` method from `render` more detail see : pixijs#4369
Yeah, agree on renderWebGL, we certainly have to decouple it somehow. |
I agree that something must be done there but your solution is not enough :( |
@ivanpopelyshev , I know the example about So , when I use JS to create a game , for performance , I would do some OK, whatever , the example about |
@finscn Is this an issue you wish to keep open, or would you like to raise a new issue with another plan of attack? Thanks! |
@themoonrat , I don't know anything about v5 and pixi-display / pixi-layer repo , so I can't answer your question now. |
@finscn im working on a way to override pixi container methods in a plugin, and your input is significant. Lets close this one, I'll address it later :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
One year ago , I created a PR #3108 .
I want to add the standalone methods about rendering & updating children.
The reason is that user could override them for controlling
which sprite/how render the sprite
by themself .example:
There is a DisplayObject-Tree:
containerA
|_____ spriteA
|_____ spriteB
|_____ spriteC
|_____ subContainerA
|_____ ... some other sprites else ...
Sometimes , I want to decide that render
which sprite/how render the sprite
by myself, like this :The logic above can't be solved by
children.sort
.If we extract the method about rendering children , user could override the
renderChildrenWebGL
&renderChildrenCanvas
, it's easy.there is another use case for
custom remove
:If no standalone
renderChildren
, users have to overriderenderWebGL , renderCanvas, renderAdvancedWebGL
, it's complex , in especialrenderAdvancedWebGL
.And if the logic in
Container.prototype.renderWebGL/renderAdvancedWebGL
changed , users have to re-override them again.But the logic of
renderChildrenWebGL
&renderChildrenCanvas
is very clear , and they won't bechanged.
One year ago , @englercj refused my PR , the reason is
performance
.In the past year , I've tested many games (more than 20 games , and more than 100 test-cases) , I found this PR is not the hotspot of performance, even never affected performance.
(BTW, I found the
updateTransformChildren
is needless , I and my friends never used it).In the real game , we could use many sprites , but the count of container is not big at the same time( in one game tick), so the 1 function-call won't take the performance down.
So I hope you could think the PR again, please, thank you.
The text was updated successfully, but these errors were encountered: