maquette icon indicating copy to clipboard operation
maquette copied to clipboard

Created an option to avoid automatically scheduling render on every event

Open drpepper opened this issue 10 months ago • 2 comments

I use Maquette within a game engine that automatically renders on every frame, so I don't want Maquette scheduling its own renders on events. I considered creating a whole new Projector but that seemed like overkill for such a small change.

I added an option scheduleRenderAfterEvents to the projector that simply skips the call to scheduleRender() when false. The option defaults to true so that it shouldn't mess up existing code.

I'm not sure about how you want to name things, so please let me know...

PS: Thanks for this library, it's wonderful!

drpepper avatar Apr 22 '24 15:04 drpepper

We created https://github.com/AFASSoftware/maquette-advanced-projector for advanced use cases for the projector, so we can keep the core library simple. Could you try using or extending that? Please let me know if this fits your use case.

johan-gorter avatar Apr 22 '24 20:04 johan-gorter

Thanks @johan-gorter. I hadn't seen that project. Indeed that would probably work. I'll try it out.

drpepper avatar Apr 23 '24 07:04 drpepper

Hi @johan-gorter - I was able to get that to work with maquette-advanced-projector, thanks.

However, there is an issue with that package, which doesn't work off the bat. I had to add commands to build the CJS and UMD packages. If you have access to it, perhaps you would review my pull request there?

https://github.com/AFASSoftware/maquette-advanced-projector/pull/14

Thanks a lot

drpepper avatar May 29 '24 14:05 drpepper