Path: chuka.playstation.co.uk!news From: "Steve Dunn" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: how made his own font ? Date: Fri, 14 Aug 1998 10:19:59 +0100 Organization: Backroom Software Ltd. Lines: 56 Message-ID: <6r0vps$n7i6@chuka.playstation.co.uk> References: <35C81A30.4ACB@club-internet.fr> <35C82DDB.3E12E37C@scee.sony.co.uk> <01bdc061$2c186980$f30b0a0a@Angela1.intelligent-group.com> <35D2E01D.5CA1@mdx.ac.uk> NNTP-Posting-Host: usera499.uk.uudial.com X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Check out my 'srcolly.exe' demo (~steved). This uses lots and lots of sprites, as it repeats the scrolly message several times down the screen. As you'll see, it's quite fast (even for C++). I don't think theres much overhead decrementing a few hundred bytes for the sprites. I'm sure the gpu would hardly even notice that you're moving a few hundred 'fast sprites' by 1 or 2 pixels. The biggest overhead will probably be in the code that loops through the co-ordinates. If you've got your sprites in an array, you could optimise things; instead of using a loop use: --sprite[0].x; --sprite[1].x; --sprite[2].x; ... --sprite[99].x; It may not look very nice but it'll probably be quicker than a loop(never tried it though, hence the 'probably'). I used to use that method when writing for the C64 to move the screen and manipulate other 'large' areas of memory. Another way would be to use self modifying code. Steve Robert Swan wrote in message <35D2E01D.5CA1@mdx.ac.uk>... >minor variation on a theme here - > >In my game i dont want multiple sprites on screen (especially as text >messages will be several hundred chars long) so Ive done it a different >way. Copied the tim with all the letters onto it from main memory to >video memory, and then i create a sprite and set the attributes manually >to use part of the video memory that is at present empty. Then I process >a string in the same way as the other guys and use MoveImage (as opposed >to drawing with sprites off screen (shudder!)) to copy one letter from >the font to the correct area where the sprite is. Result is that all >messages end up on only one sprite (nicer to handle etc etc) not sure >about overhead costs (although I think it should be slightly quicker to >set up) > >One problem with this is that MoveImage only works on long boundaries >(unlike sprite processing, which is dependant on colour depth) meaning >Ive had to make my font a 32k colour tim, otherwise when it comes to >cutting and pasting each letter, they would have to be done on 4 pixel >boundaries for 16 colour, and 2 pixel boundaries for 256 colour. seeing >as I want each letter to have a proportional width, I need to be able to >manipulate on a per pixel basis, hence 32k colour. > >Nice thing about doing it this way, (as you should see in my demo when >it goes up today) (plug) is that you can do nice effects, such as, one >sprite showing all text normally, and another sprite using same texture >image slightly offset and using subtractive semitransparency (method 2) >to create that 'relief' effect. > >Maybe after the compo Ill give out the source in a small routine, but >cant be arsed right now :)