Brush Patterns Feature #23
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SketchyMaze/doodle#23
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This is an idea how to implement patterned brushes for drawing levels in Doodle.
Instead of each palette being just a simple solid color (red, black, blue) a palette swatch could have a "pattern" image associated to it.
A pattern could be a small, tile-able image (say 32x32 pixels). When a pixel is plotted in the level, it would sample the pattern image to pick the color for the pixel instead of just setting a simple color.
The pixel sampling algorithm would be:
(1200,1234)
)1200 % 32, 1234 % 32
)Importantly, the color choice is handled dynamically, not hard-set in the level data; the level data just says, "the palette swatch with pattern X.png has a pixel set at world coordinate X,Y" and the color is computed as it's being rendered (and the chunk cached to image as normal).
Possible applications of this are:
A possible "mode" of the pattern could combine the swatch Color with the greyscale pattern so it can be applied to any color. For example the "pencil graphite texture" would be a grayscale image and a black, red, or blue swatch color would be able to use it.
Data attributes to be added to a palette swatch:
When Doodle supports embedding assets inside level files, the user can attach a custom pattern image and otherwise it will use the built-in patterns.