Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Elliott Lee Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Combining multiple images in TIMs for frame animation Date: Wed, 22 Jul 1998 18:26:21 -0700 Organization: Cisco Systems Lines: 69 Message-ID: <35B6913D.308CB2B@jps.net> References: <35B67C25.42A6@cadgraphics.com.au> Reply-To: tenchi@jps.net NNTP-Posting-Host: dhcp-m-62-247.cisco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (Win95; U) At least to get the one big TIM, just use your favourite 2D editor (e.g. Photoshop) and make each of your frames of animation the same size (e.g. 32x48). Now create one very large new image and just cut/paste the images side by side. Crop that strip afterwards. So, for example, if you had 10 images at 20x40 resolution, you'd end up with a strip that is 200x40. So, when you load your TIM into memory, you just bump the u member up by 20. If you wanted to make it a little more readable (albeit slower), you could make an array of offsets: #define PIX_PER_BYTE 1 #define NUM_FRAMES 10 #define FRAME_WIDTH 20 int FrameOfs[NUM_FRAMES; int CurFrame=0,OrigUOffset; GsSPRITE MyTim; // ... other stuff in between ... for( i=0; i > I'm trying to get some sprites up that animate nicely when you control > them with the pad (ie. say a stick figure - press right and his legs > move, etc.). My initial idea of loading all the frames into memory and > then switching between them when needed was clunky and hard to program, > now having looked at some tutorials on Yaroze pages, I've discovered > that you can combine multiple frames into one .TIM file (and then > combine all the necessary .TIMs into one big .PAK file or something for > easier downloads), and then use the GsSPRITE members u and v to change > between frames on the fly. Unfortunately, none of the tutorials I've > found actually tell you how to set up this big .TIM. Can somebody please > answer a confused newbie's cries and give me a quick rundown on how to > achieve the said animation? > > -- > - David "DM" Treay (the tribe that hides from Man) > dmtreay@cadgraphics.com.au -- Mata ne, ... ... - e! ::' tenchi@shell.jps.net ':: (Protocol) :: ACiD -/- ACS -/- pHluid -/- Yaroze -/- Nemesis :: (Tenchikun) ::. http://www.jps.net/tenchi .:: ''' '''