540 Programming
TEXTOUT_P
TEXTOUT Syntax: TEXTOUT(text [ ,G], x, y [ ,font, c1, width, c2])
TEXTOUT_P(text [ ,G], x, y [ ,font, c1, width,
c2])
Draws text using color c1 on graphic G at position x, y
using font. Do not draw text more than width pixels wide
and erase the background before drawing the text using
color c2. G can be any of the graphics variables and is
optional. The default is G0.
Font can be:
0: current font selected in mode screen, 1: small font 2:
large font. Font is optional and if not specified is the
current font selected on the Homes Settings screen.
c1 can be any color specified as #RRGGBB. The default is
black (#000000).
width is optional and if not specified, no clipping is
performed.
c2 can be any color specified as #RRGGBB. c2 is
optional. If not specified the background is not erased.
Example:
This program displays the successive approximations for
using the series for the arctangent(1). Note that a color for
the text, and for background, has been specified (with the
width of the text being limited to 100 pixels).
EXPORT RUNPISERIES()
BEGIN
LOCAL sign;
2
K;4 A;
-1
sign;
RECT();
TEXTOUT_P("N=",0,0);
TEXTOUT_P("PI APPROX=",0,30);
REPEAT
A+sign*4/(2*K-1)
A;
TEXTOUT_P(K ,35,0,2,
#FFFFFF,100,#333399);