Repository navigation
Rust sketch API - #284
Draft
tychedelia wants to merge 4 commits into
Draft
Rust sketch API#284tychedelia wants to merge 4 commits into
tychedelia wants to merge 4 commits into
Conversation
|
Visual regression: 1 changed of 43 cases
If these changes are intentional, add the baseline |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a sketch API to the top-level
processingcrate, so a Rust sketch can look like a Processing sketch:Some notes:
Functions with several signatures take tuples:
fill(255),fill((255, 0, 0)),translate((x, y)). Optional arguments chain on the end, as with.radius()above.Draw calls record straight away and return a small guard. The guard can still change the command it recorded until the next flush, where the engine tracks this with a command slot. push() and begin_shape() return guards that pop or end when they go out of scope. This is a style thing that we definitely can discuss more.
The engine re-exports that the bindings use moved from
processing::preludetoprocessing::engine.preludeis now the sketch prelude. This is sa large mechanical change.