views:

39

answers:

1

I'm new to squeak/squeak source and i am writing a small game as a learning exercise. I have a few graphics that i am using for some of my sprites (mostly pngs) but i cannot figure out how to add them to my squeak source repository.

Is there a way to do add these files to my project so my team doesn't have to keep emailing images to each other.

Thanks

=== Final solution ===

Based on Lukas' advice i ended up creating a class that only hold methods which produce images. unfortunately actually writing these methods was kind of a pain (esp for large images).

So i created a helper method on the class that allows you to add an image message dynamically.

addIcon: selector fromFile: fn
    | image stream |
    image := ColorForm fromFileNamed: fn.
    stream := WriteStream with: String new.
    stream nextPutAll: ((selector asString) , (String cr), '^').
    image storeOn: stream.
    (IconsHolder class) compile: (stream contents) classified: 'auto-generated'.
    ^self. 

So then if i wanted to update or add an image i could just do:

IconsHolder addImage: #image... fromFile:'image.jpg'

And it would generate a new message in IconsHolder that would generate the image from code.

+2  A: 

Monticello does not provide support to version external resources, this has nothing to do with SqueakSource as the hosting system. Most developers put their resources (small images, scripts, resources, ...) into methods, see the classes OBMenuIcons in OmniBrowser or WAFileLibrary in Seaside for prominent examples.

Lukas Renggli
Thanks, i guess this is one way to do it
luke