home *** CD-ROM | disk | FTP | other *** search
/ DarkBasic Professional / DarkBasicPro.iso / data1.cab / Lang_Files_(English) / Help / examples / basic2d / basic2d2-example.dba < prev    next >
Encoding:
Text File  |  2004-09-22  |  932 b   |  40 lines

  1. rem Basic2D Functionality
  2.  
  3. rem Test loop
  4. do
  5.  
  6. rem Produce random values
  7. X=mousex()
  8. Y=mousey()
  9. X1=rnd(320)
  10. Y1=rnd(240)
  11. X2=X1+1+rnd(320)
  12. Y2=Y1+1+rnd(240)
  13. RgbForeValue=RGB(rnd(255),rnd(255),rnd(255))
  14. RgbBackColor=RGB(rnd(255),rnd(255),rnd(255))
  15. RadiusValue=rnd(100)
  16. RadiusX=rnd(100)
  17. RadiusY=rnd(100)
  18. ComponentValue=rnd(255)
  19.  
  20. rem Try each command at random
  21. if rnd(500)=1 then CLS RgbBackColor
  22. if rnd(5)=1 then INK RgbForeValue, RgbBackColor
  23. if rnd(5)=1 then DOT X1, Y2
  24. if rnd(5)=1 then BOX X1, Y1, X2, Y2
  25. if rnd(5)=1 then LINE X1, Y1, X2, Y2
  26. if rnd(5)=1 then CIRCLE X, Y, RadiusValue
  27. if rnd(5)=1 then ELLIPSE X, Y, RadiusX, RadiusY
  28.  
  29. rem Display data
  30. set cursor 0,0
  31. print "BASIC2D EXPRESSION DATA"
  32. print
  33. print "point:";POINT(X, Y)
  34. print "rgb:";RGB(ComponentValue,ComponentValue,ComponentValue)
  35. print "rgbr:";RGBR(RgbBackColor)
  36. print "rgbg:";RGBG(RgbBackColor)
  37. print "rgbb:";RGBB(RgbBackColor)
  38.  
  39. loop
  40.