C Language Development Kit/Functions/SetOffset
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/Set offset)
| Description | This function can be used to exactly align a character in the Y-direction on
the screen. The function allows you to print a character a defined number of pixels below the position where it should be printed given the Y-coordinate of its cursor position. This makes it possible to align lines of text with different font sizes. |
| Syntax | void set_offset(int offset); |
| Arguments | The offset of the next printed character.
int offset |
| Returns | None |
| Remarks | The offset is set back to zero when the display is cleared. |
| Example | #include "lib.h" #include <stdio.h> void main( void ) { systemsetting("WK"); // Key click on while( 1 ) { setfont( TINY_FONT, 0); printf("\fHello world"); gotoxy( 0, 0); set_offset( 6 ); setfont( SMALL_FONT, 0); printf("Hello world"); gotoxy( 0, 0); set_offset( 8+6 ); setfont( MEDIUM_FONT, 0); printf("Hello world"); gotoxy( 0, 0); set_offset( 8+6+12 ); setfont( LARGE_FONT, 0); printf("Hello world"); resetkey(); while( !kbhit()) idle(); } } |
