Original Author Paul Laughton, 2011
Page 167
De Re BASIC!
Hide and Show Commands
Gr.hide <object_number_nexp>
Hides the object with the specified Object Number. If the Object is a Group, all of the Graphical Objects
in the Group are hidden. This change will not be visible until the Gr.render command is called.
Gr.show <object_number_nexp>
Shows (unhides) the object with the specified Object Number. If the Object is a Group, all of the
Graphical Objects in the Group are shown. This change will not be visible until the Gr.render command
is called.
Gr.show.toggle <object_number_nexp>
Toggles visibility of the object with the specified Object Number. If it is hidden, it will be shown. If it is
shown, it will be hidden. If the Object is a Group, all of the Graphical Objects in the Group are toggled.
This change will not be visible until the Gr.render command is called.
Touch Query Commands
If the user touches the screen and then moves the finger without lifting the finger from the screen, the
motion can be tracked by repeatedly calling on the touch query commands. This will allow you to
program the dragging of graphical objects around the screen. The Sample Program, f23_breakout.bas,
illustrates this with the code that moves the paddle.
The OnGrTouch: label can be used optionally to interrupt your program when a new touch is detected.
The touch commands report on one- or two-finger touches on the screen. If the two fingers cross each
other on the x-axis then touch and touch2 will swap.
Gr.touch touched, x, y
Tests for a touch on the graphics screen. If the screen is being touched, Touched is returned as true (not
0) with the (x,y) coordinates of the touch. If the screen is not currently touched, Touched returns false
(0) with the (x,y) coordinates of the last previous touch. If the screen has never been touched, the x and
y variables are left unchanged. The command continues to return true as long as the screen remains
touched.
If you want to detect a single short tap, after detecting the touch, you should loop until touched is false.
DO
GR.TOUCH touched, x, y
UNTIL touched

! Touch detected, now wait for
! finger lifted
DO
GR.TOUCH touched, x, y
UNTIL !touched