background image
Original Author Paul Laughton, 2011
Page 184
De Re BASIC!
For example, you can make an object slowly appear and disappear, just by changing its alpha with
Gr.modify.
Do
For a = 1 to 255 step 10
gr.modify object,"alpha",a
gr.render
pause 250
next a
For a = 255 to 1 step -10
gr.modify object,"alpha",a
gr.render
pause 250
next a
until 0
GR_COLLISION(<object_1_nexp>, <object_2_nexp>)
GR_COLLISION() is a function, not a command. The variables <object_1_nvar> and <object_2_nvar> are
the object pointers returned when the objects were created.
If the boundary boxes of the two objects overlap then the function will return true (not zero). If they do
not overlap then the function will return false (zero).
Objects that may be tested for collision are: rectangle, bitmap, circle, arc, oval, and text. In the case of a
circle, an arc, an oval, or text, the object's rectangular boundary box is used for collision testing, not the
actual drawn object.
Gr.clip <object_ptr_nexp>, <left_nexp>, <top_nexp>, <right_nexp>, <bottom_nexp>{,
<RO_nexp>}
Objects that are drawn after this command is issued will be drawn only within the bounds (clipped) of
the clip rectangle specified by the "left, top, right, bottom" numeric expressions.
The final parameter is the Region Operator, <RO_nexp>. The Region Operator prescribes how this clip
will interact with everything else you are drawing on the screen or bitmap. If you issue more than one
Gr.clip command, the RO prescribes the interaction between the current Gr.clip rectangle and the
previous one. The RO values are:
0
Intersect
1
Difference
2
Replace
3
Reverse Difference
4
Union
5
XOR
The Region Operator parameter is optional. If it is omitted, the default action is Intersect.