TftPrintSndString()

Library Description ›› Fonts ›› SND ››
… visits
Parent Previous Next

Syntax

TftPrintSndString(sString As sTftString, bFontSize As Byte, wX_Pos As Word, wY_Pos As Word, pPosition As Bit, wForeColor As Word, wBackColor As Word, pTransparent As Bit)

Parameters

Parameter

Description

sString

null-terminated string to print (up to 72 characters)

bFontSize

font size

Overview

wX_Pos — x position for the lower left corner of the first character

wY_Pos — y position for the lower left corner of the first character

pPosition — position type for the lower left corner of the character

wForeColor — character color in 16-bit RGB565 format - used to set pixels forming the glyph

wBackColor — background color in 16-bit RGB565 format - empty pixels within the glyph's bounding box will use this color

pTransparent — transparency option

Print string using SND font.

Example

TftPrintSndString("TEST", 2, 1, 1, 0, WHITE, BLACK, 0)

Note: If transparency is enabled, the background color (wBackColor) will be ignored, and only the pixels of the glyph will be printed. However, this is slower than using a background color.


$define FontSmooth          1

$define FontMaxSpace        16

$define FontMaxPixels       16

Include "TftLib\Fonts\SND\F2_SND_16x16_Basic.inc"

'....

TftSetUp(0, 0)

TftSetSndFont(2,0)

TftResetScreen(BLUE)

TftPrintSndString("Hello!", 1, 10, 10, 0, WHITE, BLACK, 0)

TftPrintSndString("Hello!", 1, 120, 13, 0, WHITE, BLACK, 1)

TftPrintSndString("Hello!", 1, 1, 2, 1, WHITE, BLACK, 0)

TftPrintSndString("Hello!", 1, 8, 2, 1, WHITE, BLACK, 1)

TftPrintSndString("Hello!", 2, 0, 2, 1, WHITE, BLACK, 0)

TftPrintSndString("Hello!", 2, 0, 3, 1, WHITE, BLACK, 1)

TftSetSndFont(2,1)

TftPrintSndString("Hello!", 2, 0, 4, 1, WHITE, BLACK, 0)

TftPrintSndString("Hello!", 2, 0, 5, 1, WHITE, BLACK, 1)

TftPrintSndString()

Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source