func_graphics_max2d_drawrect.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .. _func_graphics_max2d_drawrect:
  2. ========
  3. DrawRect
  4. ========
  5. DrawRect -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. DrawRect( x#,y#,width#,height# )
  10. Draw a rectangle
  11. Sets the color of a rectangular area of pixels using the current drawing color
  12. defined with the #SetColor command.
  13. Other commands that affect the operation of #DrawRect include #SetHandle, #SetScale,
  14. #SetRotation, #SetOrigin, #SetViewPort, #SetBlend and #SetAlpha.
  15. Parameters
  16. ==========
  17. Return Values
  18. =============
  19. Nothing.
  20. Examples
  21. ========
  22. .. code-block:: blitzmax
  23. ' drawrect.bmx
  24. ' draws a sequence of rectangles across the screen with
  25. ' increasing rotation and scale
  26. ' uses the frame variable to cycle through the values 0..9 for
  27. ' an animation effect between frames
  28. Graphics 640,480
  29. SetBlend ALPHABLEND
  30. SetAlpha 0.2
  31. While Not KeyHit(KEY_ESCAPE)
  32. Cls
  33. DrawText "DrawRect Example",0,0
  34. For r=t To t+500 Step 10
  35. SetRotation r
  36. SetScale r/5,r/5
  37. DrawRect r,r,2,2
  38. Next
  39. t=t+1
  40. If t=10 t=0
  41. Flip
  42. Wend
  43. See Also
  44. ========