DECLARE SUB DQBxPut (BYVAL SourceLayer, BYVAL x1, BYVAL y1, BYVAL x2,
BYVAL y2, BYVAL DestLayer, BYVAL x, BYVAL y)
SourceLayer - Layer where to get the sprite (source)
x1 - x position of upper left corner of the sprite on source
y1 - y position of upper left corner of the sprite on source
x2 - x position of lower right corner of the sprite on source
y2 - y position of lower right corner of the sprite on source
DestLayer - Layer where to draw the sprite (destination)
x - x position of upper left corner of the sprite on destination
y - y position of upper left corner of the sprite on destination
none
Like normal DQBput, this function draws a sprite onto a specified layer, but with a huge difference: DQBxPut does not require that you first get your sprite into a QB array, as it automatically gets the data by assuming you want to draw the sprite contained into the (x1,y1)-(x2,y2) box on the source layer. Sprite data is directly copied into the destination layer at specified (x,y) coordinates; this is great, but it has its weak spots... When both the source and destination layers are on EMS, DQBxPut is slower than DQBput; in addition it can only handle sprites with a height up to 50 pixels: higher sprites will not be drawn (but there are no limits for the width).
DQBxPut supports transparency and it's affected by the clipping box, so pixels outside this box will not be drawn. It is strongly suggested that you use this function to draw from an EMS layer onto a layer in base memory; this way you can achieve almost the same speed of DQBput, without the need of extra memory to hold the sprite. See also DQBput, DQBfPut, DQBsPut, DQBrPut and DQBbPut.
*****************************************************************************
' Here's a modified version of the DQBput example; this time we'll not use
' arrays to store our sprites...
' All integers for speed
DEFINT A-Z
'$INCLUDE: 'DIRECTQB.BI'
' Let's initialize the library with two extra layers and no sounds nor EMS
IF DQBinit(2, 0, 0) THEN DQBclose: PRINT DQBerror$: END
' Let's prepare our sprites on layer 2
FOR i = 0 TO 14
' Draws a frame of our sprite
DQBbox 2, (i * 16), 0, (i * 16) + 15, 15, 4
DQBline 2, (i * 16) + (15-i), 15, (i * 16) + i, 0, 40
DQBline 2, (i * 16) + 15, i, (i * 16), (15 - i), 40
NEXT i
DQBinitVGA
FOR i = -16 TO 320
' Empties layer 1
DQBclearLayer 1
' Finds what frame to draw
Frame = ((i + 16) \ 2) MOD 15
' Draws our frame into layer 1
DQBxPut 2, (Frame * 16), 0, (Frame * 16) + 15, 15, 1, i, 92
' Waits for vertical retrace 1 time
DQBwait 1
' Copies layer 1 onto the screen
DQBcopyLayer 1, VIDEO
NEXT i
' Ends program
DQBclose
*****************************************************************************
=============================================================================
APPENDIX A - Library constants
=============================================================================
To simplify the use of certain functions, the file DIRECTQB.BI contains some
useful constants. Here's the list:
Constant name Value Can be used by