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
New Animation API #157
base: main
Are you sure you want to change the base?
New Animation API #157
Conversation
✅ Deploy Preview for dsi-logo-maker ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an initial set of comments. For now I just checked the core and engine changes, I'll leave the checking of the actual function updates for a bit later.
@fdoflorenzano thanks for the initial set of comments. I just addressed them. From my point of view this should now be ready for you to play with writing some design functions using the new API to see how it feels 😊 /cc @runemadsen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @lnolte ! Most comments are address, so yeah I also think it's a good point to check the actual functions. I'll try and do that tomorrow :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found something! (Will continue reviewing!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked all functions finally!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for #169 into this first and then merge if @runemadsen also approves!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yezzzz, let's get this sucker in!
…rameloop Add timestamp to frameloop
TL;DR
Adds a draw loop helper to mechanic core. This helper is exposed to design functions through the engine. The goal of this is to remove boilerplate from design functions.
Implements the changes explored and discussed in #156
What this does
Core
frameRate
setting to mechanic instance (defaults to 60)defaultSettings
file that is merged with user provided settings (mostly to create visibility for the default settings)registerFrameCallback
andregisterDoneCallback
methods to mechanic corecallbacksForEngine
to mechanic coreframe
,done
,drawLoop
…) that an engine can pass to a functionAll engines
registerFrameCallback
,registerDoneCallback
andcallbacksForEngine
)frame
,done
anddrawLoop
to the design function directly, instead of on themechanic
object passed instate
andsetState
remain onmechanic
to avoid namespace collisions with ReactEngine Canvas
getCanvas
helper to engine that provides the user with a density-aware preview canvasgetCanvas
a user no longer needs to passcanvas
todone
orframe
done
andframe
still accept a canvas to be passed to them, to keep it backwards compatible with functions creating their own canvasEngine p5
sketch.frameRate
withmechanic.settings.frameRate
before starting rendering on the sketchDSI Logo Maker
Logo Animated SVG
renders a bit stuttery, but this does not seem to be related to the changes. It's the same onmain
Create-Mechanic
Discussion
I tried to keep this PR as concise as possible, but given it needs to touch almost all parts of mechanic it has become fairly large. I also tried to be expressive with code comments and added
TODO
labels where I feel unsure about a decision I've made. Looking forward to discussing this.