delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/16/22:40:53

From: "Stefan Viljoen" <rylan AT intekom DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Scrolling Text with Allegro 3.1
Date: 17 Mar 1999 03:02:06 GMT
Organization: The South African Internet Exchange
Lines: 31
Message-ID: <01be7074$22e36e00$LocalHost@default>
References: <36E989ED DOT 83142786 AT fuse DOT net> <aGfH2.3426$dy5 DOT 7790 AT nntpserver DOT swip DOT net>
NNTP-Posting-Host: pc25-01-p10.saix.net
X-Trace: news3.saix.net 921639726 6868 196.25.111.160 (17 Mar 1999 03:02:06 GMT)
X-Complaints-To: abuse AT saix DOT net
NNTP-Posting-Date: 17 Mar 1999 03:02:06 GMT
X-Newsreader: Microsoft Internet News 4.70.1155
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Jon DeMarks wrote in message <36E989ED DOT 83142786 AT fuse DOT net>...
> >How can I get the text to scroll for my game, here is my function thus
> >far:
> >
> >void print_str(char *str) { char *c; int i,x; i=0; x=10;
> >if(!str[0]) return; do { c=str[i]; textout(text_layer,font,c,x,10,15);
> >animate_layers(); x=x+8; i++; } while(str[i]!=0); }
> >
> >any suggestions?

Use "sliding" bitmaps - that is how I did it. You put the text on one, the
background it is to be animated over in another, with a third "master"
bitmap holding the background. Then

1) Draw the text on the temporary text bitmap.
2) Blit this to the slider bitmap.
2) Blit slider to screen in a certain x position, increment the x when done
to get movement.
3) Erase the slider bitmap from the master bitmap
4) Repeat from 2

If you do not catch it mail me - I have working code that does exactly
this.


-- 
Spawned By Rylan
Rylan AT intekom DOT co DOT za
http://home.intekom.com/rylan/

Power Overwhelming

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019