Maybe the ants demo will help - http://tinyurl.com/29rqe5r

On Sep 14, 9:55 am, Lee Spector <lspec...@hampshire.edu> wrote:
> I'm looking for a way to do simple colored-lines-and-shapes graphics in a 
> window that requires:
>
> - No libraries beyond what is built into java, clojure 1.2, and 
> clojure-contrib (which is what one gets automatically in a new 
> Eclipse/Counterclockwise project).
>
> - As little additional code as possible.
>
> I'd like one function that takes a window title, window dimensions, and 
> possibly window position, and which has the side effect of producing the 
> window on the screen. Then I'd like functions that can be called dynamically 
> to add lines, rectangles, and ellipses, to the window, each taking position 
> (x & y), size (h & v), and color (r, g, b, and it'd be swell to have alpha if 
> it's easy). If it's simpler to set the color in a separate call before the 
> shape drawing call then that would be fine too.
>
> There's a fair amount of example code out there but most of it does something 
> beyond what I want, like handling keystrokes, and there seem to be a couple 
> of approaches to doing this -- both in terms of the gui/graphics java 
> libraries/calls to use and in terms of the way that the state of the drawing 
> is maintained. I have code derived from the snake game example, among other 
> sources, but it's not as clean as I would like and I'm interested in seeing 
> how those more familiar with the java libraries would approach this.
>
> Perhaps someone will find this an amusing challenge, to produce as simple a 
> graphics library as possible (with simplicity as defined above)?
>
> BTW I have clj-processing working for more significant graphics work, but I 
> would like to have a simpler, "no libraries" approach for pedagogical 
> purposes.
>
> Thanks,
>
>  -Lee
>
> --
> Lee Spector, Professor of Computer Science
> School of Cognitive Science, Hampshire College
> 893 West Street, Amherst, MA 01002-3359
> lspec...@hampshire.edu,http://hampshire.edu/lspector/
> Phone: 413-559-5352, Fax: 413-559-5438
>
> Check out Genetic Programming and Evolvable 
> Machines:http://www.springer.com/10710-http://gpemjournal.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to