FR: Callback or other mechanism for exposing Component debugging/timing

You’re right, it’s called at every VBLank event, and it’s main use case is to update the Component’s state in lockstep with the screen refresh and have smooth animations that way. So you’d actually call repaint() from inside a VBlank callback when necessary.

The Component relationship is indeed for deciding which peer to attach to.

I can see now that it’s not exactly useful for your use case, because it doesn’t in any way line up with the paint times of one particular Component. In fact first all VBlankAttachment will be notified, then all Components that need it will be redrawn. So there will be a varying amount of time before the VBlank and the call time of paint() for one particular Component depending on how long other components took to paint.

I’d like to say it’s the VBlankAttaché’s job to relay these events, so there’s an extra ment at the end :wink:, but you’re right.

1 Like