Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. ;
  2. ; ------------------------------------------------------------
  3. ;
  4. ; SpiderBasic - 2D Drawing example file
  5. ;
  6. ; (c) Fantaisie Software
  7. ;
  8. ; ------------------------------------------------------------
  9. ;
  10.  
  11. If OpenWindow(0, 100, 200, 300, 200, "2D Drawing Test", #PB_Window_TitleBar)
  12.  
  13. ; Create an offscreen image, with a green circle in it.
  14. ; It will be displayed later
  15. ;
  16. If CreateImage(0, 300, 200)
  17. If StartDrawing(ImageOutput(0))
  18. Box(0, 0, 300, 300, RGB(230,230,230)) ; Set the background to white
  19.  
  20. Circle(100,100,50,RGB(0,0,255)) ; a nice blue circle...
  21.  
  22. Box(150,20,20,20, RGB(0,255,0)) ; and a green box
  23.  
  24. FrontColor(RGB(255,0,0)) ; Finally, red lines..
  25. For k=0 To 20
  26. LineXY(10,10+k*8,200, 0)
  27. Next
  28.  
  29. DrawingMode(#PB_2DDrawing_Transparent)
  30. BackColor(RGB(0,155,155)) ; Change the text back and front colour
  31. FrontColor(RGB(0,0,0))
  32. Text$ = "Hello World !"
  33.  
  34. LoadFont(0, "times", 30)
  35. DrawingFont(FontID(0))
  36.  
  37. DrawText(10, 150, Text$)
  38.  
  39. StopDrawing()
  40. EndIf
  41. EndIf
  42.  
  43. ; Create a gadget to display our nice image
  44. ;
  45. ImageGadget(0, 0, 0, 300, 200, ImageID(0))
  46. EndIf
  47.  
  48. SpiderLaunch = function() {
  49. spider.debug.Init();
  50. spider_InitFunctions();
  51. if (spider_OpenWindow(0,100,200,300,200,_S1,8)) {
  52. if (spider_CreateImage(0,300,200)) {
  53. if (spider_StartDrawing(spider_ImageOutput(0))) {
  54. spider_Box(0,0,300,300,spider_RGB(230,230,230));
  55. spider_Circle(100,100,50,spider_RGB(0,0,255));
  56. spider_Box(150,20,20,20,spider_RGB(0,255,0));
  57. spider_FrontColor(spider_RGB(255,0,0));
  58. v_k=0;
  59. for (;20>=v_k;v_k+=1) {
  60. spider_LineXY(10,((v_k*8)+10),200,0);
  61. }
  62. spider_DrawingMode(1);
  63. spider_BackColor(spider_RGB(0,155,155));
  64. spider_FrontColor(spider_RGB(0,0,0));
  65. v_text$=_S2;
  66. spider_LoadFont(0,_S3,30);
  67. spider_DrawingFont(spider_FontID(0));
  68. spider_DrawText(10,150,v_text$);
  69. spider_StopDrawing();
  70. }
  71. }
  72. spider_ImageGadget(0,0,0,300,200,spider_ImageID(0));
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement