'>>> Page 8 of CODE0398.FAQ begins here.
OUT &H64, &HFE
Warm boot:
DEF SEG = &HFFFF
CALL ABSOLUTE(0)
9) HOW CAN I PRINT TEXT IN A GRAPHICS MODE WITHOUT DESTROYING
THE BACKGROUND?
The problem with PRINTing text on top of graphics is that
QB blacks out the entire character box for each character
you print. That means that the graphics underneath your
new text are just erased from the screen. Not good, in some
cases. The following routine by Douglas Lusher is a very good
substitute for the PRINT command, as it offers styles for two
different graphics modes. Just "comment-out" the statements
for the mode you don't want to use, and "un-comment" those that
you do want to use. Note: if you use the style for VGA
modes, you must load QB with the /L switch.
[begin]
SUB GPrint (X%, Y%, Text$, Culler%)
'this routine allows printing text at any pixel location
' in the graphics modes without disturbing the background
'by Douglas H. Lusher, 06-08-1996
' 8 x 8 char box, CGA
CharSegment% = &HFFA6: CharOffset% = &HE
CharWid% = 8: CharHgt% = 8
' 8 x 16 char box, VGA
'DIM Register AS RegTypeX
'Register.AX = &H1130
'Register.BX = &H600
'CALL InterruptX(&H10, Register, Register)
'CharSegment% = Register.ES: CharOffset% = Register.BP
'CharWid% = 8: CharHgt% = 16
DEF SEG = CharSegment%
XX% = X%
FOR Char% = 1 TO LEN(Text$)
Ptr% = CharHgt% * ASC(MID$(Text$, Char%, 1)) + CharOffset%
FOR Ln% = 0 TO CharHgt% - 1
BitPattern& = PEEK(Ptr% + Ln%) * 256&
LineFormat% = (BitPattern& - 32768) XOR -32768
LINE (XX%, Y% + Ln%)-STEP(CharWid% - 1, 0), Culler%_
, , LineFormat%
NEXT
XX% = XX% + CharWid%
NEXT
DEF SEG
END SUB
[end]
10) HOW CAN I ANIMATE SPRITES IN QB?
First thing, what's a sprite? Basically, it's a rectangle box
that has a picture in it. In something like cartoon animation,
they would be referred to as frames. So when you're animating
in QB, you're essentially doing the same thing that you would do
if you were to create a cartoon, just on a smaller scale.
So how do you create sprites? QB has a variety of graphics
functions (DRAW, LINE, CIRCLE, PSET, etc.) at your disposal.
They are quite cumbersome to use, so you might find it difficult
to get started. You may want to keep your eyes open for a QB
graphics editor; there are probably a lot of them.
Coincidentally (?), Dave Shea has written a graphics program
for QB (edited insignificantly by David Aukerman):
"Spectra.13 was designed specifically for drawing graphics in
QB. It is totally mouse-controlled, has a handy pop-up menu,
features many handy utilities (draw, erase, paint, line, circle,
filled circle, box, filled box, text, Bitmap loading, palette
manipulation, save & load pictures, save & load icons, on-line
help, etc. etc. etc.) It's probably the most comprehensive QB
drawing program available, or at least the best of what I've
seen. If you have Net access, you can pick it up from
Ftp.Cdrom.Com (I believe that's how it goes, I don't have a clue
when it comes to FTP. The filename should be SPECTRA.ZIP). For
the rest of us who don't have Net access, since it was just
'>>> Page 8 of CODE0398.FAQ ends here. Continued on next page.
___
* SLMR 2.0 * "Captain, why not just give the Borg Windows 95?" - Worf
--- Maximus/2 3.01
---------------
* Origin: The I.O. Board - 4GB -XX- V34+ (1:2255/10)
|