beautypg.com

HP Prime Graphing Calculator User Manual

Page 549

background image

Programming in HP PPL

543

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 on the Homes Settings 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:
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 specified (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;