/*
          __
         / /_______________  ____  ___
        / __/ ___/ ___/ __ \/ __ \/ _ \
       / /_(__  ) /__/ /_/ / /_/ /  __/
       \__/____/\___/\____/ .___/\___/
                         /_/

    graphics4.c
    setting the text background color
*/

#include <tscope.h>


int main()
{
    ts_scrsize(SIZE1);
    ts_init();

    // use default parameters
    ts_printf_centre(0, 110, "default, text appears in white");
    ts_line(-XMAX, 90, XMAX, 90);
    ts_printf_centre(0, 90, "on a transparent background");

    // change foreground color  
    ts_fgcolor(RED);
    ts_printf_centre(0, 70, "ts_fgcolor changes the color");
    ts_line(-XMAX, 50, XMAX, 50);
    ts_printf_centre(0, 50, "but the background remains transparent");

    // change text background color
    ts_textmode(BLUE);
    ts_line(-XMAX, 30, XMAX, 30);
    ts_printf_centre(0, 30,
                     "ts_textmode changes the text background color");
    ts_textmode(ts_makecolor(255, 255, 128));
    ts_printf_centre(0, 10,
                     "it accepts any valid color value as parameter");

    // set text background color back to transparent
    ts_textmode(TRANS);
    ts_printf_centre(0, -10, "the predefined value TRANS means:");
    ts_line(-XMAX, -30, XMAX, -30);
    ts_printf_centre(0, -30,
                     "set the text background color back to transparent");

    ts_button(XMAX - 20, -YMAX + 20);
    return 0;
}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information