Original Author Paul Laughton, 2011
Page 155
De Re BASIC!
Coordinates are measured with respect to the physical screen, not to anything on it. If you choose to
show the Android Status Bar, anything you draw at the top of the screen is covered by the Status Bar.
Drawing into Bitmaps
You can draw into bitmaps in addition to drawing directly to the screen. You notify BASIC! that you want
to start drawing into a bitmap instead of the screen with the Gr.bitmap.drawinto.start command. This
puts BASIC! into the draw-into-bitmap mode. All draw commands issued while in this mode will draw
directly into the bitmap. The objects drawn in this mode will not be placed into the Object List. The
Object Number returned by a draw command while in this mode is invalid and should not be used for
any purpose including Gr.modify.
The draw-into-bitmap mode is ended by the Gr.bitmap.drawinto.end command. Subsequent draw
commands will place the objects on the Object List and object numbers in the Display List for rendering
on the screen. If you wish to display the drawn-into bitmap on the screen, issue a Gr.bitmap.draw
command for that bitmap. The drawn-into bitmap may be drawn at any time before, during or after the
draw-into process.
Colors
BASIC! colors consist of a mixture of Red, Green, and Blue. Each component has a numerical value
ranging from 0 to 255. Black occurs when all three values are zero. White occurs when all three values
are 255. Solid Red occurs with a Redvalue of 255 while Blue and Green are zero.
Colors also have what is called an Alpha Channel. The Alpha Channel describes the level of opaqueness
of the color. An Alpha value of 255 is totally opaque. No object of any color can show through an object
with an Alpha value of 255. An Alpha value of zero renders the object invisible.
Paints
BASIC! holds drawing information such as color, font size, style and so forth, in Paint objects. The Paint
objects are stored in a Paint List. The last created Paint object (the "Current Paint") is associated with a
graphical object when a draw command is executed. The Paint tells the renderer (see Gr.render) how to
draw the graphical object. The same Paint may be attached to many graphical objects so they will all be
drawn with the same color, style, etc.
Basic usage
You can ignore Paints. This can keep your graphics programming simpler.
Each command that changes a drawing setting (Gr.color, Gr.text.size, etc.) affects everything you draw
from that point on, until you execute another such command.
Advanced usage
You can control the Paint objects used to draw graphical objects. The extra complexity allows you to
create special effects that are not otherwise possible. To use these effects, you must understand the
Paint List and the Current Paint.