Ooops
November 24, 2020, 06:07:12 AM

Author Topic: [bmx] Quick and Dirty Graphic Console by zoqfotpik [ 1+ years ago ]  (Read 920 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Quick and Dirty Graphic Console
Author : zoqfotpik
Posted : 1+ years ago

Description : This is just drawtext with automatic linefeeds for situations when you don't want to worry about doing a text layout manually, or when you want something printed every frame for debugging purposes but want it vastly faster than the Blitzmax Print command.

Code :
Code: BlitzMax
  1. Global currenttextline:Int = 0
  2. Graphics 640,480
  3. While Not KeyDown(KEY_ESCAPE)
  4.         Cls
  5.         currenttextline = 0
  6.         consoleprint "Just a quick and dirty console"
  7.         consoleprint "This is in case you don't like using the slow-ass blitzmax output"
  8.         consoleprint "console for text output when writing tools or whatever."
  9.         consoleprint "Don't expect this to solve world hunger."
  10.         consoleprint ""
  11.         consoleprint "Drawtext is slow."
  12.         consoleprint "If you really wanted to you could speed this up massively"
  13.         consoleprint "by using masking and grabimage to memoize your console into a bitmap"
  14.         consoleprint "every time the text you are displaying changes."
  15.         consoleprint "and then every frame draw one bitmap as opposed to x number of characters."
  16.         consoleprint "If I remember right that's the way the Quake console did it..."
  17.  
  18.         Flip
  19. Wend
  20.  
  21. Function consoleprint(toprint$)
  22.         currenttextline:+12
  23.         DrawText(toprint$,10,currenttextline)
  24. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal