Those beauty Building Blocks of Scratch programm, what kind of method you developers used to paint them onscreen, on the source code level? Are the symbols available for download and use in other projects?
I'm sorry, I can't access the Squeak-source, so I can't find it myself.
Thanks!
Offline
Ok, I got the source code visible now. I start Squeak this way:
~/Scratch/squeak/3.9-8$ ./squeak ScratchSourceCode1.2.1.image
I don't know if this is the right way to start it? I get some error messages, but the source, i think, is now searchable.
But now I need a bit more help, because I am quite new to Scratch, Squeak and Smalltalk. How can I find the block painting routines in the object browser? I mean, lets take example: I want to convert the blocks to other programming language, so the need is to get simple routines like: set pen color: BLACK, paint rectangle at (x1,y1,x2,y2) = (10,10,100,20), floodfill it red, put some text, etc...
Offline
Hi Snifi.
There is a class called BlockMorph. You might want to inspect its class hierarchy, and have a look at the category named "drawing" on the instance side. There you'll find (some of) what you're looking for, although, as John already pointed out, it's really just lines, rectangles and text.
If you're only interested in the graphics and the attaching/detaching behavior, you might also have a look at my "PuzzlePieces" code on SqueakMap: http://map.squeak.org/package/173b6802-59fa-4580-bdde-482511240a41
Overall it might be easier to reimplement Scratch "from Scratch" in Python than to try directly transforming it from Smalltalk. However, if I remember correctly there might already be some tile-based Python extension inspired by Etoys around somewhere, I just can't find the link to it right now (but I'll keep looking...)
Offline
Okay, here are some other links you might want to check out:
- TurtleArt on the XO: http://wiki.laptop.org/go/Turtle_Art
- PataPata (this one's in Python for sure): http://sourceforge.net/projects/patapata
- PyMorphic: http://pymorphic.sourceforge.net
Offline