BBS: Inland Empire Archive Date: 05-13-92 (14:48) Number: 97 From: JEAN CREPEAU Refer#: NONE To: MICAH SHERR Recvd: NO Subj: Fading The Screen Conf: (2) Quik_Bas
In a message to ALL, MICAH SHERR wrote: MS=> Dear Experienced QuickBASIC Programmer, MS=> I'm designing this great new game with VGA/MCGA graphics and SoundBLASTER support. So far this is working out perfectly. However, I need a routine to fade the screen (in mode 13). I think you can do this with the palette statement. Please write back to me telling me how to do this, and if at all possible, write a small routine for me. Thanx. MS=> -Micah Sherr Use the following subroutine: Sub Fade(Pal&()) Do Palette Using Pal&(0) R&=0 For I=0 to 255 P&=Pal&(I) If P& AND &h3F Then P&=P&-1 If P& AND &h3F00 Then P&=P&-&h100 If P& AND &h3F0000 Then P&=P&-&h10000 Pal&(I)-P& R&=R& Or P& Next Loop While R& End Sub This subroutine will fade your palette of 256 colors. You can add a timer check to fade it regularly (and/or slow it down). There is a problem with this subroutine; the colors change slightly while they are fading. Jean --- * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET