func_graphics_max2d_drawpoly.rst 871 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .. _func_graphics_max2d_drawpoly:
  2. ========
  3. DrawPoly
  4. ========
  5. DrawPoly -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. DrawPoly( xy#[] )
  10. Draw a polygon
  11. #DrawPoly draws a polygon with corners defined by an array of x#,y# coordinate pairs.
  12. BlitzMax commands that affect the drawing of polygons include #SetColor, #SetHandle,
  13. #SetScale, #SetRotation, #SetOrigin, #SetViewPort, #SetBlend and #SetAlpha.
  14. Parameters
  15. ==========
  16. Return Values
  17. =============
  18. Nothing.
  19. Examples
  20. ========
  21. .. code-block:: blitzmax
  22. ' drawpoly.bmx
  23. ' draws a simple triangle using the
  24. ' DrawPoly command and an array of
  25. ' floats listed as 3 pairs of x,y
  26. ' coordinates
  27. Local tri#[]=[0.0,0.0,100.0,100.0,0.0,100.0]
  28. Graphics 640,480
  29. While Not KeyHit(KEY_ESCAPE)
  30. Cls
  31. DrawPoly tri
  32. Flip
  33. Wend
  34. See Also
  35. ========