Brush Patterns Feature #23
Labels
No labels
bug
doodad
enhancement
levels & doodads
security
ui toolkit
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SketchyMaze/doodle#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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.