Paint manually a background behind a string taking into account the properties in okf.
int OkfPaintBackground( unsigned char *pStr );
int OkfPaintBackgroundAt( int x, int y, unsigned char *pStr );
Routine | Required Header |
OkfPaintBackground | "okf.h" |
OkfPaintBackgroundAt | "okf.h" |
Libraries
OKLIB.A | Oankali's GP32 run-time library |
Return Value
In case of success these printing functions return 0, otherwise these return -1. Look at okf.lastError for details on what happened.
Parameters
x
An integer value that indicates the horizontal coordinate where to paint the background.
y
An integer value that indicates the vertical coordinate where to paint the background.
pStr
A pointer to the string used as reference to calculate the dimensions of the background.
Remarks
The okf.background
properties are used to paint a background behind a string to be rendered by the OKF
Font Engine. With this method, it is very easy to set up, for example, a
program menu with highlighted options.
If okf.background.opacity > 0, a background is painted automatically
by OkfPrint functions.
These functions can be used to paint manually the background taking into account all the properties settled in okf.background (color, opacity, indents, etc...), and the dimensions on screen of the string pointed by pStr.
OkfPaintBackground uses the current cursor position to print the data.
OkfPaintBackgroundAt uses x and y as starting cursor position to print the data.
okf.x and okf.y are not updated as in OkfPrint functions.
If okf.background.onPaint points to a valid call back function, the code to paint the background is bypassed and the call back function is called with the screen dimensions of the string pointed by *pStr, to paint the background. That way, the string background can be completely customized.
See Also
OKF Font Engine Routines, OKF Font Engine Constants, OkfPrint