The drawing commands are somewhat confusing in that they reference parts of the 'plot', not parts of the physical screen.
It is intuitive to assume that (knowing that the screen is 131x64 pixels wide, and that the calculator references points by a Cartesian-like system) a pixel at (1,1) willalways be the most bottom-right pixel on the screen.
However, this is not the case. (1,1) is the pixel at (1,1) on the infinite 'plot'. This means that it willonly be the bottom-right pixel, as expected, when the plot is set to the dimensions 1?X?131 and 1?Y?64. This can be done by setting the (X/Y)(MIN/MAX) commands to appropriate values:
1?XMIN:131?XMAX:1?YMIN:64?YMAX:
Adding this code to the start of your program will set the calculator's plot size to these specifications automatically, ensuring smooth operation of your program. However, upon the program's completion, any graph the user might have set up will be displayed on a (presumably) incorrect plotsize, which may frustrate the user. You could work around this like follows:
XMIN?A:XMAX?B:YMIN?C:YMAX?D:1?XMIN:131?XMAX:1?YMIN:64?YMAX:<program code goes here>A?XMIN:B?XMAX:C?YMIN:D?YMAX
Of course, this adds bloat to the program somewhat, but will resolve the problemas long as you don't use the variables you selected in the program for other purposes. An alternate method would be to store the values in a list.
Syntax
ARC <cent-x>;<cent-y>;<radius>;<start>;<end>:
Detail
Dangers
1?HAngle:
Example
ARC 65;32;15;0;360:
Draws a full circle of radius 15px, from the center of the screen.
ARC 65;32;15;10;80:ARC 65;32;15;100;170:ARC 65;32;15;190;260:ARC 65;32;15;280;350:
Draws a full circle comprised of four arcs, but the circle is missing a arc of 20° at each cardinal point.Represented more concisely using a loop:
FOR X=0 TO 270 STEP 90;ARC 65;32;15;10+X;80+X:END:
Syntax
BOX <x1>;<y1>;<x2>;<y2>:
Detail
Example
BOX 1;1;131;64:
Draws a box around the border of the screen.
BOX 1;1;131;64:BOX 2;2;130;63:
Draws a border 2 pixels thick around the screen. More concisely:
FOR X=0 TO 1;BOX 1+X;1+X;131-X;64-X:END:
This allows you to easily adjust the thickness of your border by simply adjusting the FOR command; for "FOR X= TO Z" the border will always be (Z-1) pixels thick.
Syntax
ERASE:
Detail
Syntax
FREEZE:
Detail
Syntax
LINE <x-start>;<y-start>;<x-end>;<y-end>:
Detail
Example
LINE 1;1;131;64:LINE 1;64;131;1:
Draws a cross across the screen.
Syntax
PIXON <x>;<y>:PIXOFF <x>;<y>:
Detail
Dangers
Example
FOR X=1 TO 131 STEP 1;FOR Y=64 TO 1 STEP -1;PIXON X;Y:END:END:FOR X=131 TO 1 STEP -1;FOR Y=1 TO 64 STEP 1;PIXOFF X;Y:END:END:
Fills the screen with pixels from left-to-right, top-to-bottom, then reverses the process.
Syntax
TLINE <x-start>;<y-start>;<x-end>;<y-end>:
Detail
Example
ERASE:DISPLAY? G1:GROBNOT G1:?DISPLAY G1:TLINE 1;1;131;64:TLINE 1;64;131;1:
Draws a cross in white across the screen, after turning on all the pixels. Therefore, it acts the same as:
ERASE:LINE 1;1;131;64:LINE 1;64;131;1:DISPLAY? G1:GROBNOT G1:?DISPLAY G1: