func_graphics_max2d_drawtext.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .. _func_graphics_max2d_drawtext:
  2. ========
  3. DrawText
  4. ========
  5. DrawText -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. DrawText( t$,x#,y# )
  10. Draw text
  11. #DrawText prints strings at position @x,@y of the graphics display using
  12. the current image font specified by the #SetImageFont command.
  13. Other commands that affect #DrawText include #SetColor, #SetHandle,
  14. #SetScale, #SetRotation, #SetOrigin, #SetViewPort, #SetBlend and #SetAlpha.
  15. It is recomended that the blend mode be set to ALPHABLEND using the #SetBlend
  16. command for non jagged antialiased text. Text that will be drawn at a smaller
  17. size using the #SetScale command should use fonts loaded with the SMOOTHFONT
  18. style to benefit from mip-mapped filtering, see #LoadImageFont for more information.
  19. Parameters
  20. ==========
  21. Return Values
  22. =============
  23. Nothing.
  24. Examples
  25. ========
  26. .. code-block:: blitzmax
  27. ' drawtext.bmx
  28. ' scrolls a large text string across the screen by decrementing the tickerx variable
  29. Graphics 640,480
  30. Local tickerx#=640
  31. text$="Yo to all the Apple, Windows and Linux BlitzMax programmers in the house! "
  32. text:+"Game development is the most fun, most advanced and definitely most cool "
  33. text:+"software programming there is!"
  34. While Not KeyHit(KEY_ESCAPE)
  35. Cls
  36. DrawText "Scrolling Text Demo",0,0
  37. DrawText text,tickerx#,400
  38. tickerx=tickerx-1
  39. If tickerx<-TextWidth(text) tickerx=640
  40. Flip
  41. Wend
  42. End
  43. See Also
  44. ========