Skip to content

Instantly share code, notes, and snippets.

@honix
Last active July 31, 2017 20:45
Show Gist options
  • Save honix/912b126e981108b347e7c6ed67e9894a to your computer and use it in GitHub Desktop.
Save honix/912b126e981108b347e7c6ed67e9894a to your computer and use it in GitHub Desktop.
Drawing app
Work in progress!
Red [
Needs: 'View
]
pen-buffer-settings: [500x500 0.0.0.254]
buffer: make image! [500x500 100.100.100]
pen-buffer: make image! pen-buffer-settings
line-array: []
color: 50.0.50.100
canvas: layout [
at 10x10 image buffer
at 10x10 image pen-buffer
on-down [append line-array event/offset]
on-up [
line-array: copy []
draw buffer [image pen-buffer]
pen-buffer: make image! pen-buffer-settings
face/image: pen-buffer
]
all-over
on-over [if find event/flags 'down [
append line-array event/offset
draw pen-buffer: make image! pen-buffer-settings
append copy [
pen color
line-join round
fill-pen color
line-width 25
line
] line-array
face/image: pen-buffer
]
]
]
view canvas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment