Sketch is a versatile Common Lisp framework designed for the creation of electronic art, visual design, and game development. Inspired by the Processing Language, it empowers artists and developers alike to easily prototype and create engaging visuals. Compatible with all major Common Lisp implementations, Sketch simplifies the exploration of human-computer interaction in an accessible manner.
Sketch is an innovative Common Lisp framework designed for the creation of electronic art, visual design, game prototyping, game making, computer graphics, and the exploration of human-computer interaction. It draws inspiration from the widely recognized Processing Language and shares similarities in its API, making it an exciting tool for both seasoned developers and newcomers in the field of creative coding.
Features
- Comprehensive Drawing Functions: Use functions like
rect
,circle
,bezier
, andpolygon
to unleash your creativity and produce intricate graphics effortlessly. - Animation and Interaction: With built-in support for event handling, Sketch allows you to create dynamic, interactive sketches that respond to user input, such as mouse clicks and keyboard presses.
- Customizable Graphics: Define and customize your sketches simply using the
defsketch
macro to manage properties like window size, fill colors, and stroke weights. - Color Management: Easily manipulate colors using a variety of models, including RGB, HSB, and grayscale, or utilize the predefined colors for quick access.
- Inputs and Events: Capture user interactions seamlessly through method definitions that handle clicks, keyboard input, and cursor movements.
- Rich Documentation and Examples: A comprehensive tutorial section guides users on effectively utilizing all features, along with numerous code examples to illustrate common tasks.
Getting Started
To get a feel for what Sketch can do, run the provided examples in your REPL:
CL-USER> (ql:quickload :sketch-examples)
CL-USER> (make-instance 'sketch-examples:hello-world)
Drawing Basics
Start your sketch by defining it with defsketch
, where you can easily incorporate shapes and colors:
(defsketch my-sketch ()
(background +yellow+)
(rect 100 100 200 200))
Advanced Features
Sketch empowers you with advanced features such as:
- Transformation Utilities: Utilize
translate
,rotate
, andscale
to manipulate your graphics and create stunning visual compositions. - Text and Image Handling: Integrate text and images into your sketches with functions for loading resources and displaying formatted text.
- Custom Pens: Create distinct drawing styles using the
with-pen
macro to customize fill color, stroke color, and weight. - Canvas Support: Develop detailed graphics on a pixel level with canvas operations, allowing for rapid prototyping and complex image manipulations.
Summary
Sketch is a powerful tool for artists and developers alike, providing a robust environment to explore the realms of electronic art and interactive design. Whether you're prototyping games or crafting artwork, Sketch offers the flexibility and features necessary to bring your ideas to life.