Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ElPeque

Colored ASCII in C/C++ URGENT!

This topic is 5830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Colored ASCII in C/C++ URGENT! How do you do that? I mean, how do you write ascii characters with color? cout, printf? Is there any function such as LocateText(x,y) or something? Is there any way to access a linear buffer of characters in the screen? (i mean in a polite way, non assembly, i mean standard ansi c, etc) Please help!!! ElPeque __________________ Alejandro Martínez

Share this post


Link to post
Share on other sites
Advertisement
all those are compiler dependent. what is your compiler?

in turbo c++:
#include <conio.h>
textcolor(forecolor);
textbackground(backcolor);
gotoxy(xpos,ypos);


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
I am currently using Cygwin (the one from cygnus). Not my choice, but i have to use this for the univercity.

I think it is a port of the unix compiler.

Thanks a lot for your help =O)

__________________
Alejandro Martínez

Share this post


Link to post
Share on other sites
quote:
Original post by alnite
all those are compiler dependent.

They''re also system dependent. The console capabilities of a VT100 terminal far outstrip a Win32 console terminal, though the former can be simulated on the latter.

For Unix-like systems, look into ncurses and color terminals; for Win32, browse MSDN for the console-related functions, particularly those pertaining to console text attributes (...FOREGROUND_RED, ...BACKGROUND_RED, etc).

Share this post


Link to post
Share on other sites
If you don''t mind writing some funky code, you can use the OEM font (looks like DOS) in a windows form, DrawText and the color functions to so whatever color combinations you need.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!