Hi,

For a small game that I was making in order to get accustomed to factor, 
I needed to load textures from a sprite sheet. Basically, I wanted to 
take an image and split it into pieces of fixed dimensions. I wasn't 
able to find words to help me there (may be there are and I am unaware). 
So I ended up introducing a few new words:

new-image-like: create a new empty image having properties of an 
existing image but with modified dimensions

image-part: extract a part of an image into a separate image

generate-sprite-sheet: given an image, produce a sequence of images 
having fixed width and heights

These new words can be seen implemented here: 
https://github.com/rationalrevolt/factor-practice/blob/master/images/sprites/sprites.factor

A small test program using these words is present here: 
https://github.com/rationalrevolt/factor-practice/blob/master/sprite-test/sprite-test.factor

If these are useful, could someone recommend a vocabulary that could 
contain them? The words new-image-like and image-part could reside in 
the images vocab. I'm not sure where the generate-sprite-sheet word 
could fit in or if it is sufficiently useful to include.

Thanks,
Sankar


------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to