modifying image on backbuffer

BlitzMax Forums/BlitzMax Programming/modifying image on backbuffer

lotonah(Posted 2008) [#1]
Okay, I'm stuck. I'm trying to create a ASCII emulator; the reason is that OSX doesn't have support for ASCII and I want to convert some of my old ASCII Turbo Pascal games over to BM.

I'm taking a text file that has the pixel data and plotting it out on the pixmap. I then grab a 8x8 image and put it into an array, which I can use to print a character to the screen.

That works fine. But now I want to have code that can change the color of the text. NOT text that's already shown to the user, but go back and change the text color (foreground and background) for all future printed text. And that's where I'm stuck.

Any help?

P.S., one of the main reasons that I'm using a text file to store the data is I also plan on re-using this to create character sets that look like Atari and Commodore character sets for other conversion projects.

You'll need this text file for testing:

Click here!




lotonah(Posted 2008) [#2]
I should also mention that once this code is working I'll be posting it on here for everyone to use in their projects, I'm certain that I'm not the only one who's needed something like this. :)


Zeke(Posted 2008) [#3]
when you make custom font, use only White(255,255,255) and Transparent color(ex. 255,0,255). and convert pixmap to Timage..

then you can use ANY foreground color(setcolor r,g,b).. and when you want to use different background color just drawrect before chraracter.

here is example:

font image:


and code:



lotonah(Posted 2008) [#4]
Wow, that works quite well... now I just have to figure out how to implement it (already have it plotting to white and pink (aka transparent). I'm guessing I'll have to retrofit my code with more object-oriented stuff (which I've been trying to avoid because I haven't really made the mental leap yet).

Thanks!


MGE(Posted 2008) [#5]
"I'll have to retrofit my code with more object-oriented stuff (which I've been trying to avoid because I haven't really made the mental leap yet)."

That's what's nice about Bmax, the cool OO stuff is there when/if you need it. ;)