DrawBlock.htm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>DrawBlock image, x,y [,frame]</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. image = variable of the image pointer <br />
  13. x = x location to draw the image <br />
  14. y = y location to draw the image <br />
  15. frame = image's frame to draw (optional - default is 0)
  16. </td>
  17. </tr>
  18. </table>
  19. <h1>Description</h1>
  20. <table>
  21. <tr>
  22. <td>
  23. This is similar to the DrawImage command except that any transparency or MaskImage is ignored and the entire image (including masked colors) is drawn. The frame is optional. <br />
  24. <br />
  25. See also: DrawImage
  26. </td>
  27. </tr>
  28. </table>
  29. <h1><a href=../2d_examples/DrawBlock.bb>Example</a></h1>
  30. <table>
  31. <tr>
  32. <td>
  33. ; DrawBlock Example <br />
  34. <br />
  35. ; Turn on graphics mode <br />
  36. Graphics 640,480,16 <br />
  37. <br />
  38. ; Create new empty graphic to store our circle in <br />
  39. gfxCircle=CreateImage(50,50) <br />
  40. <br />
  41. ; Draw the circle image <br />
  42. ; Set drawing operations to point to our new empty graphic <br />
  43. SetBuffer ImageBuffer(gfxCircle) <br />
  44. Color 255,0,0 <br />
  45. ; Note the extra space between the circle and the edge of the graphic <br />
  46. Oval 10,10,30,30,1 <br />
  47. <br />
  48. ; Let's not forget to put the drawing buffer back! <br />
  49. SetBuffer BackBuffer() <br />
  50. ; Set the CLS color to white <br />
  51. ClsColor 255,255,255 <br />
  52. <br />
  53. ; Let the user move the circle graphic around a white screen <br />
  54. ; putting the graphic at the MouseX,Y coordinates <br />
  55. While Not KeyHit(1) <br />
  56. Cls <br />
  57. DrawBlock gfxCircle,MouseX(),MouseY() <br />
  58. Flip <br />
  59. Wend
  60. </td>
  61. </tr>
  62. </table>
  63. <br>
  64. <a target=_top href=../index.htm>Index</a><br>
  65. <br>
  66. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=DrawBlock&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  67. </html>