Original Author Paul Laughton, 2011
Page 168
De Re BASIC!
The returned values are relative to the actual screen size. If you have scaled the screen then you need to
similarly scale the returned parameters. If the parameters that you used in Gr.scale were scale_x and
scale_y (Gr.scale scale_x, scale_y) then divide the returned x and y by those same values.
GR.TOUCH touched, x, y
Xscaled = x / scale_x
Yscaled = y / scale_y
Gr.bounded.touch touched, left, top, right, bottom
The Touched parameter will be returned true (not zero) if the user has touched the screen within the
rectangle defined by the left, top, right, bottom parameters. If the screen has not been touched or has
been touched outside of the bounding rectangle, the touched parameter will be return as false (zero).
The command will continue to return true as long as the screen remains touched and the touch is within
the bounding rectangle.
The bounding rectangle parameters are for the actual screen size. If you have scaled the screen then you
need to similarly scale the bounding rectangle parameters. If the parameters that you used in Gr.scale
were scale_x and scale_y (Gr.scale scale_x, scale_y) then divide left and right by scale_x and divide top
and bottom by scale_y.
Gr.touch2 touched, x, y
The same as Gr.touch except that it reports on second simultaneous touch of the screen.
Gr.bounded.touch2 touched, left, top, right, bottom
The same as Gr.bounded.touch except that it reports on second simultaneous touch of the screen.
OnGrTouch:
Interrupt label that traps any touch on the Graphics screen (see "Interrupt Labels"). BASIC! executes the
statements following the OnGrTouch: label until it reaches a Gr.onGrTouch.resume command.
To detect touches on the Output Console (not in Graphics mode), use OnConsoleTouch:.
Gr.onGrTouch.resume
Resumes execution at the point in the BASIC! program where the OnGrTouch: interrupt occurred.
Text Commands
Overview
Gr.text.draw is the only text command that creates a graphical object. The other text commands set
attributes of text yet to be drawn or report measurements of text.
Each command that sets a text attribute (the Gr.text.align, bold, size, skew, strike, and underline
commands, as well as Gr.text.setfont and typeface) has an optional "Paint pointer" parameter that may
be used to specify a Paint object to modify. Normally this parameter is omitted, and the command sets a
text attribute for all text objects drawn after the command is executed. For using the Paint pointer, see
"Paints Advanced Usage", above.