DQBsetFontTexture
SUB

Prototype

DECLARE SUB DQBsetFontTexture (BYVAL TextSeg, BYVAL TextOff)

Parameters

TextSeg - Segment of the array holding the texture sprite (use VARSEG)

TextOff - Offset of the array holding the texture sprite (use VARPTR)

Returns

none

Description

Sets the texture to be used whenever the TEXTURED font style is used. Font textures must be normal sprites got with GET or DQBget, but their size must always be 8x8 pixels, otherwise you may end up with unpredictable effects. Specified texture is then used to fill the active pixels of each character of your string.

Notes:

Textures used as font textures do not support transparency. Also, the TEXTURED style does not work when applied together with the BOLD one, due to internal library limitations. If you apply this combination anyway, the BOLD effect will not be considered (but the other effects will still work!).

Example

*****************************************************************************

' All integers for speed
DEFINT A-Z

'$INCLUDE:'DIRECTQB.BI'

' Dimension our 8x8 pixels texture array
DIM Texture(35)

' Let's initialize the library with one extra layer and no sounds nor EMS
IF DQBinit(1, 0, 0) THEN DQBclose: PRINT DQBerror$: END

DQBinitVGA

' Prepares the sprite that will be used as font texture on layer 1
FOR i = 0 TO 7
  DQBline 1, 0, i, i, 0, (31 - i)
NEXT i
FOR i = 0 TO 7
  DQBline 1, 7, i, i, 7, (24 - i)
NEXT i

' Get the sprite!
DQBget 1, 0, 0, 7, 7, VARSEG(Texture(0)), VARPTR(Texture(0))

' Let's set the font texture to our new one
DQBsetFontTexture VARSEG(Texture(0)), VARPTR(Texture(0))

' Prints a string on the screen
DQBprints VIDEO, "This is a textured font test!!", 0, 100, 15, TEXTURED

' Waits for the user to press a key
WHILE INKEY$ = "": WEND

' Ends program
DQBclose
END

*****************************************************************************