color in C++

This is a discussion on color in C++ within the Game Programming forums, part of the General Programming Boards category; I was wonder how to color the text/background of text in C++. What is the command to do that?...

  1. #1
    Unregistered
    Guest

    color in C++

    I was wonder how to color the text/background of text in C++. What is the command to do that?

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    dos or command prompt?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Unregistered
    Guest
    what do you mean by that? i am using microsoft visual C++ if that makes a difference...

  4. #4
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    include conio.h, and then look at it.

  5. #5
    Unregistered
    Guest
    what do you mean "then look at it"? do you mean the header file or the text?

  6. #6
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Open up the header file, and look for something on the lines of textcolor.

  7. #7
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    better yet you could use this really special tool that not many people seem to know about. click here to try out this magical tool. you'll be amazed by it's powers!

  8. #8
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Originally posted by TechWins
    better yet you could use this really special tool that not many people seem to know about. click here to try out this magical tool. you'll be amazed by it's powers!
    woooowwww...........your being sarcastic. Anyways, here's something that people actually use if they want to search: http://www.google.com

  9. #9
    Unregistered
    Guest
    um... thanx... but that doesnt really solve my problem...

  10. #10
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Ok, here's what u do *assuming you're programming this for a console app*:

    1. Go to the "Project Properties"

    2. Go to "Further Object Files or linker options"

    3. Add this in: C:\Dev-C++\Lib\conio.o *assuming C:|Dev-C++\ is the installation path, if not, then change it*

    4. Click "OK"

    5. Include the conio.h file.

    *NOTE: This is all assuming you are using Dev-C++ 4.0, but if not, then it shouldn't be hard to change*

  11. #11
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    you dont use the textcolor() function to change the text color with VC++, i cant remember what the function is called tho
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  12. #12
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    >> you dont use the textcolor() function to change the text color with VC++, i cant remember what the function is called tho

    It's called SetConsoleTextAttribute
    All spelling mistakes, syntatical errors and stupid comments are intentional.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21