开发者

SqueakSource add a resource file

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) cla开发者_如何学JAVAssified: '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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜