x2, y2 are optional and if not specied will be the bottom right of srcGRB.
x1, y1 are optional and if not specied will be the top left of srcGRB.
Example: SUBGROB(G1, G4) will copy G1 in G4.
TEXTOUT_P, TEXTOUT
Syntax: TEXTOUT(text [ ,G], x, y [ ,font, c1, width, c2])
Syntax: 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. This command returns the x-
coordinate of the pixel at the end of the text output.
Font can be:
0: current font selected on the Homes Settings screen, 1: small font 2: large font. Font is optional and if not
specied is the current font selected on the Homes Settings screen.
c1 can be any color specied as #RRGGBB. The default is black (#000000).
width is optional and if not specied, no clipping is performed.
c2 can be any color specied as #RRGGBB. c2 is optional. If not specied the background is not erased.
Example:
The following 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 specied (with the width of the text being limited
to 100 pixels).
EXPORT PISERIES()
BEGIN
LOCAL sign;
K:=2;
A:=4;
sign:=−1;
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);
TEXTOUT_P(A ,90,30,2,#000000,100,#99CC33);
sign*-1▶sign;
K+1▶K;
UNTIL 0;
Program commands 599
Comentarios a estos manuales