Color Console For AGK2.0 
Alex 'Jack' Schmidt 2018
==== online-arts.de ====

Version 1.1b

Easy Lib with some commands in order to control the console.
Beware, if you loose focus, (because you clicked on the console) you won't get input commands anymore.
This plugin is free and can be used for any work without charge.



Example AGK Code:


// Project: ConsolePlugin 
// Created: 21.10.2018

#import_plugin Console  // load console plugin


// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "ConsolePlugin" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

// dumb count system
line as integer
tick as integer
maxtick=800

// console commands:
Console.Init(20,0) // maximal 100 lines, no window close option
Console.SetTitle("Console")
Console.SetColor(46) // sets bg to green and text to yellow
Console.Clear() // clear sreen and apply color sheme
Console.SetString(0,1,"====================================================================") // some static text
Console.SetString(1,4,"Soon the color text routine starts, be prepared") // some static text
Console.Version() // print console Version to console
Console.SetSize(80,20) // set custom console size, as far as you can push it, limits are very strict
Console.SetBufferSize(80,18) // set custom console buffer size

do



	if GetRawKeyPressed(32) // Press SPACE to toggle console visibility
		s=1-s
		Console.SetVisible(s)
	endif
	
	if line<1 // initial 'static console'

		if GetRawKeyState(27) // Press ESC Key to toggle display text 
			Console.SetString(1,3,"[ESC] Yes. Now its pressed          ") // overwrite previous used chars by using space key
		else
			Console.SetString(1,3,"[ESC] key pressed? No, not yet   ")
		endif

		Console.SetString(57,4,str(tick)+" / "+str(maxtick)) // continous update
		
		Console.SetString(57,3,"FPS: "+str(ScreenFPS(),3))   // continous update

	endif
	

	if GetRawKeyPressed(13) then Console.Clear() // clear console by pressing ENTER

	inc tick
	if tick>maxtick
		maxtick=60
		inc line
		color = mod(line,255)
		Console.SetColor(color)
		Console.PrintCon("")	
		Console.PrintCon("Multi color Console Output in AGK for Windows x32")
		Console.PrintCon("Made by Jack - alex04.schmidt@gmail.com        Line: "+str(line*4-1) + "    color: "+str(color))
		Console.PrintCon("")
		tick = 0
	endif


    Print( ScreenFPS() )
    Sync()
loop

quit:
	Console.Close() // closes a console, frees allocation
	end
return
