-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Ticker for front scene only #38
Comments
Is a good point, my understanding is that Darts ticker will request a new frame to the backend window, forcing a rendering in the CustomPainter anyway, I might be wrong though. The only way i know you can save redrawing is a RepaintBoundry() widge. Its been a while since i check graphx internals… But i guess a custom class that overrides SceneController behaviour when creating the CustomPainter might do the trick of skipping update/render calls per Scene |
Thanks for your quick reply @roipeker My knowledge on this topic is limited, when I saw this code
I though it would be trivial to simply tick the front scene only instead of ticking them both depending on the config but I don't fully understand what is happening behind the scene (no pun intended lol) and whether it's possible to actually only have the foreground painter to update without triggering the main / background painter as well. |
@tlvenn Yep, the flow is not straightforward, and code lacks docs comments. SceneController initializes the logic of the scene. Creates the Ticker, outputs the When you pass So, here's where the That's pretty much the flow. I hope it makes some sense. So, as you see there're a few variables around that comes from
That's about it. |
Thanks for the explanation @roipeker, i was actually kinda roughly thinking it was working like that. In the end, if only the front scene updates, I would expect the
On that note, what is the proper way to request an update / paint for a scene with no tick / auto updater ? |
Well, Isnt so straightforward cause painting and internal update (enter frame) processing happens on different functions but under the same “ticker”. i hope i didn't over explain the idea. Cant check the code currently to give u a more accurate response |
Btw, just to be clear… graphx was built as a prototype tool, for fun... To make an API more familiar to Flash, or some js rendering engine like Pixie. My focus was to have fun while coming up with something to experiment ideas. I doubt i would approach a major refactor now, but today i would definitely face it differently. Much of the API was the solution i came up at the time… so Im sure there is much room for improvement. |
Hey no worry at all, yes it's not straightforward, what I wanted to convey was that I had a good mental model of the role the SceneController` was playing not necessarily about its internals or the minutia of the framerates and the like. I appreciate your swift replies, thanks again for that. I also understand the inception of this project and do value what it brings already on top of custom painters even if there are rough edges and the documentation is outdated. |
Hi,
Currently the scene config and the ticker code assumes that if you want a ticker, you want it to cover both scenes but there are scenarios where you want control over when to render / update the back scene which contains heavy things to draw but let Graphx redraw the front / hud scene automatically.
Could we have an enum (
tickerScope
maybe ?) in the scene config to drive this ? I think you either wantboth
orfront_only
.The text was updated successfully, but these errors were encountered: