You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we could share functionality between sketches, and also if the sketch could be instantiated with user-supplied parameters. For this I suggest an alternative defsketch interface, while keeping the old one for simplicity / backward compatibility.
Example defsketchx interface (x is for "extended", maybe?):
(defsketchx my-sketch (some-mixin-class another-mixin-class)
;; These can be passed by the user to make-instance
(x (y 100))
((width 200)
(height 400))
(circle (or x 50) y))
Then instantiation might look like (make-instance 'my-sketch :x 70 :y 120). Maybe some-mixin-class hooks into draw and always provides a black background.
The specific application I have in mind is having a widgets-window class that automatically creates a separate window with sliders/buttons to modify the sketch parameters.
It would be nice if we could share functionality between sketches, and also if the sketch could be instantiated with user-supplied parameters. For this I suggest an alternative
defsketch
interface, while keeping the old one for simplicity / backward compatibility.Example
defsketchx
interface (x
is for "extended", maybe?):Then instantiation might look like
(make-instance 'my-sketch :x 70 :y 120)
. Maybesome-mixin-class
hooks intodraw
and always provides a black background.The specific application I have in mind is having a
widgets-window
class that automatically creates a separate window with sliders/buttons to modify thesketch
parameters.The text was updated successfully, but these errors were encountered: