Console Module v.0.53

Community Forums/Showcase/Console Module v.0.53

klepto2(Posted 2005) [#1]
To learn a bit about OOP and the usage in BMAX I have created
a little Module which creates and manage a Console.

Currently available commands(0.53):
Type Console:
Create(width,height,alpha,maxChars)
update()
SetStatus(st:int) ; 1 = Visible 0 = Hidden
Set_alpha(_al:Float) ; 0 - 1 Sets a new Alpha value
Return_Alpha():Float ; returns the current Alpha value
Return Status():Int ; returns the current Status
Return_last():String ; Returns the last entered String
SetFPS(F_ST:Byte) ; enables/disables FPS in the topright of the console
Send_Text(txt:String) ; Send a string directly to the Console (maybe good for debugging)
Set_CursorSpeed(_blink:int) ; sets the blink time of the cursor.

[Edit:]
Edited the Cursor to be independent from the framerate and added new command for the Cursor Blinktime.
The Code is not well written but doesn't use much CPU.
Also fixed a bug which appears when you edit a String with the Cursor keys.

the Update method have to be at the end of your main loop(before the flip command).



And here a working sample :



and now enjoy.

BTW: Critic and Suggestions are welcome :)


semar(Posted 2005) [#2]
Nice one, and works !

:)

Sergio.


klepto2(Posted 2005) [#3]
New Version available. Version 0.6 has some new things added and can be download now.

http://klepto2.kl.funpic.de/DL/

(ConsoleMod.Rar)

Features added:

change of the Object name (Console --> CConsole) in case of Confusion
Color setting
Adding of a Watchsystem (for Debugging and BetaTesting)
already compiled

more about in the Readme.txt and in the Sample

Please post your Opinions and your Suggestions because I want to know what I could make better (its my first Module).

BTW : THX Semar


klepto2(Posted 2005) [#4]
New Version available:
Version 0.7

Added support for static and animated Images
Added support for Fonts
Added optional frame for the Console Window




klepto2(Posted 2005) [#5]
Here is my updated Console Module for Bmax

Console Module Version 1.0
--------------------------

Features:

Full OOP Design (IMO)
Uses Max2d (so I think it may compatible with later 3DModule by Mark)
COnfigureable size
FPS Counter
Watch Functions
Sending Text to the Console and receiving Input from the Console
Alpha support
Easy to use
Different Fonts usable
static and animated Images as background supported
Frame supported
Frame could be changed via runtime
Roll in and out feature
Caption support

Complete Functions and Method list:


Download at : http://www.brsoftware.de.vu/DL/

Most bugfixes are done, but if you find something let me know. Also some Feedback would be nice.


Booticus(Posted 2005) [#6]
Awww man! I get Blitz telling me there's too many function parameters! Any clues? I tried rebuilding all the modules too. No love. Using BlitzMax 1.09. :(


klepto2(Posted 2005) [#7]
Is this when you call the CConsole.Create function.

When yes could you tell me the line in which you create it?


Booticus(Posted 2005) [#8]
Well when I dont make it a module, it works fine. :) Who knows. I always seem to have lame trouble with modules. Suck! BUT ANYWAYS, it works awesome! I had your version 06 one and was very impressed! This one is even better. Keep it up!


klepto2(Posted 2005) [#9]
Thx Booticus.

Maybe the new Version does work better.

Version 1.01 :

Added Method : Return_TrimText(_trim:int)
Added multiline support for sended text.

http://www.brsoftware.de.vu/DL/

File : ConsoleMODV101.rar


klepto2(Posted 2005) [#10]
I have uploaded a hotfix for Bmax 1.10
It fixes Import things with glmax2d and d3d7max2d
and it fix some changes which had come with the Update of Bmax.

File: consolehotfix.rar


klepto2(Posted 2005) [#11]
New Update available : Version 1.02

file: ConsoleMODV102.rar (hotfix included)
Download at : http://www.brsoftware.de.vu/DL/

fully compatible to Bmax 1.10
Added Method Return_TrimText2(_trim:String)

What does it ?
Trimming a return Text to different parts :
i.e : the Return_text 'Load Map MyMap.dat' will result in

text[0] = 'Load'
text[1] = 'Map'
text[2] = 'MyMap.dat'

by using following code :

local text:String[]
text = c.Return_TrimText[32] ' The '32' stays for the ASCII Code of
' " " in this case

After that you can get the different parts of text by using a For next loop.
For further details look in the sample.
Added another method quite the same as Return_TrimText but this is called
Return_Trim_text2(_Trim:String)

Instead of giving an int to the Method like in the first method you
can enter a String like " :" or "ABCDEF"

The difference between both methods is the following :
In some cases you have entered a text like "Load Map:MyMap.dat"

With Method 1 (Return_TrimText(32)):

text[0] = 'Load'
text[1] = 'Map:MyMap.dat'

With Method 2 (Return_TrimText2(" :")):

text[0] = 'Load'
text[1] = 'Map'
text[2] = 'MyMap.dat'

I hope you see the advantage of the two methods.