[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] transform.chop and image cropping
On 9/1/07, James Paige <Bob@xxxxxxxxxxxxxxxxxxx> wrote:
> On Sat, Sep 01, 2007 at 12:54:13PM +1200, Greg Ewing wrote:
> > This sounds to me like something that ought to be done
> > once when you're creating the artwork, using some suitable
> > tool, before the image even gets into your game. I can't
> > see a reason for doing it at run time.
> >
> Artwork can change many times during the development of a game, and as
> an artist, I often like to keep a margin around the edges of an
> image. It can make changes easier.
>
There's also another artist technique where empty space is
deliberately used as a way of being able to set an image hotspot (the
origin of the image). Basically no file format gives you a way to set
a hotspot, but if the image loader assumes the center of the image is
the hotspot then the artist can render images to take advantage of
that. For it to work the image loader needs to be aware of the meaning
of the empty space.
Granted, like Greg said, an external l tool could be used to both crop
such images and provide hotspot metadata instead of having the code
for that work in the game - but maintaining external tools is a
hassle, I like to embed such things in the game engine.