command line text colour

BlitzPlus Forums/BlitzPlus Beginners Area/command line text colour

El Neil(Posted 2006) [#1]
is there any way to change the colour of the text when you are writing to a normal text window in blitzplus? im making a text adventure engine and need to change the font colour for each character.

cheers

neil


El Neil(Posted 2006) [#2]
just read through what i had written and it didnt make much sense.

basically, if your .bb file consists of this single line:

print "hello world"


then bb prints it to a default screen which looks like the command line. it is in a default font with a default color (white). we are making a retro text adventure using this method (unless anyone can suggest a better one) and would like to change the colour of the output text.

can anyone help?

cheers
neil


Grey Alien(Posted 2006) [#3]
I saw this when you posted it but really don't know how to do it. Maybe you could search the Internet for DOS color codes or something as really the console is like dos and maybe you just output a certain character to change the color? Or maybe it's impossible and always white.


CS_TBL(Posted 2006) [#4]
Why would you want to do that in a console anyway? Both in a graphics mode or a canvas you can perfectly print text with any color.. can be equally retro I'd say!


Grey Alien(Posted 2006) [#5]
yeah plus do slightly more things. If you want the text to pass off the top of the screen like dos, just make an array of strings which you draw down the screen by looping, and everytime you want to add a new line and the array is full, shuffle all the lines up by one index and put your new line on the bottom :-)


El Neil(Posted 2006) [#6]
hmm. yeah, i see what youre getting at. just thought it would be easier to type "print..." then to type "text x,y,"jklgf",true,false,etc,etc." , especially as with a text adventure theres loads to display. i'll have a look on t'internet for the dos codes but if not i'll use graphics mode.

cheers guys

neil


CS_TBL(Posted 2006) [#7]
you don't need to type additional things that can be left out eh..

In most cases 'Text "bla",0,0' is all you need..

Apart from that, how often did you intend to use the pring or text command anyway? I'd hope you didn't intend to make a print/text command for each and every line in your story!

You'd have one print function that just prints whatever you want to print, in any color, and that's all. Additionally you can have function arguements to make the text bold (print it twice with x+1) etc.


El Neil(Posted 2006) [#8]
we are using a text file created with excel to hold all of the data for the game, ie object locations, lines of dialogue, descriptions of things etc. and then using a function to display relevant data. its pretty much just as you described just then but the function "print"s rather than "text"s to the screen. it wouldnt be much work to change it.

had a look on the net for dos colors and the user has to do all sorts of weird things manually to change the color permanently. nothing that you can do directly from bb during a program. so looks like its gonna be the graphics option.


thanks again

neil