term_fill
Previous Topic  Next Topic 

Synopsis:

        term_fill(row, column, width, height, character)


Arguments:

          row                        -

       character                - The character to write

       number_of_times        - the number of times to write the character


Description:   This function fills the given rectangular area with the first character in the string argument using the current active terminal colour for the task (as set by term_colour()).       The row and column arguments define the top left position of the rectangular area and the width and height arguments define the number of characters across and down to draw the rectangle.


Row and column numbers count from (0,0) at the top left corner of the screen.


The characters are written in the current active colour for the task as set by term_colour().


The following example loops drawing concentric rectangles of different colours:


main

int colour;


    # Loop forever..

    while(1)

        for(colour=1;colour<=12;colour++)

             # Set colour to colour on black..

             term_colour(colour,0);

             # Fills a rectangle 2 chars smaller that the current colour

             term_fill(0+colour,0+(colour*2),80-(colour*4),25-colour*2,"X");    

             # Sleep half a second

             sleep(5);

        endfor

    endwhile

end



Returns: 0 for success or -1 for error