Original Author Paul Laughton, 2011
Page 160
De Re BASIC!
Pixels drawn by the Gr.set.pixels command will be drawn as a 2x2 matrix if AntiAlias is on. To draw
single-pixel pixels, set AntiAlias off and set the stroke = 0.
You may use the optional Paint pointer parameter <paint_nexp> to specify a Paint object to modify.
Normally this parameter is omitted. See Gr.color, Advanced usage for more information.
Gr.orientation <nexp>
The value of the <nexp> sets the orientation of screen as follows:
-1 = Orientation depends upon the sensors.
0 = Orientation is forced to Landscape.
1 = Orientation is forced to Portrait.
2 = Orientation is forced to Reverse Landscape.
3 = Orientation is forced to Reverse Portrait.
You can monitor changes in orientation by reading the screen width and height using the the Gr.screen
or Screen commands.
Gr.statusbar {<height_nvar>} {, showing_lvar}
Returns information about the Status Bar. If the height variable <height_nvar> is present, it is set to the
nominal height of the Status Bar. If the showing flag <showing_lvar> is present, it is set to 0 (false, not
showing) or 1 (true, showing) based on on how Graphics Mode was opened.
The parameters are both optional. If you omit the first parameter but use the second, you must keep
the comma.
Gr.statusbar.show <nexp>
This command has been deprecated. To show the status bar on the graphics screen, use the optional
fifth parameter in Gr.open.
Gr.render
This command displays all the objects that are listed in the current working Display List. It is not
necessary to have a Pause command after a Gr.render. The Gr.render command will not complete until
the contents of the Display List have been fully displayed.
Gr.render always waits until the next screen refresh. Most Android devices refresh the screen 60 times
per second; your device may be faster or slower. Therefore, if you execute two consecutive Gr.render
commands, there will be a delay of 16.7 milliseconds (on most devices) between the two commands.
For smooth animation, try to avoid doing more than 16.7 ms of work between Gr.render commands, to
achieve the maximum refresh rate. This is not a lot of time for a BASIC! program, so you may have to
settle for a lower frame rate. However, there is no benefit to trying to render more often than 16.7 ms.
If BASIC! is running in the background (see Background() function and Home command), Gr.render will
not execute. It will pause your program until you return BASIC! to the foreground.