Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell library for 2D drawing [closed]

I basically want to create a full screen window and draw text on it in different colors and sizes (and also update the screen). I've used pygame for this in python and I'm looking for a similar library (should be fairly easy to use).

+1 if it handles input too...

like image 927
akosch Avatar asked Apr 10 '11 13:04

akosch


2 Answers

I'd recommend the new Gloss library as an easy way to get good results.

Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL and GLUT under the hood, but you won't have to worry about any of that. Get something cool on the screen in under 10 minutes.

There are also nice examples, such as:

hello world

enter image description here

and a nice example building flocking simulators

Alternatively, if it is vectors and text you want to manipulate, the diagrams package on top of cairo can yield very good results.

like image 102
Don Stewart Avatar answered Nov 18 '22 02:11

Don Stewart


If you're looking for a specialized game library, you have a number of options that you can find here. FunGEn is probably your best option out of those libraries. However, your question seems to suggest a game library would be a bit overkill, if all you're looking to do is draw text and receive input. In that case, you might opt for something simpler like HOpenGL or hsSDL. There are also several other libraries listed here.

Edit: After a bit more research, you might do well using haskgame. I've never used it myself, but it looks like it's got a few functions here that do exactly what you're looking for.

like image 35
Jeff Burka Avatar answered Nov 18 '22 03:11

Jeff Burka