Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] Setting colours for different words

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Travis13
Expert Cheater
Reputation: 0

Joined: 17 Feb 2007
Posts: 199

PostPosted: Fri Sep 26, 2008 12:12 pm    Post subject: [C++] Setting colours for different words Reply with quote

how do u set only specific parts of the wording coloured like this?

cout << "Hello World" << endl;

but i only want "World" in red and keep everything else the same

i know its been ansered many times before but i cant find it after searching lots around here and google

Thanks,
Travis13

_________________
Learning C++, trying, failing, never gonna give up tho Razz
Back to top
View user's profile Send private message MSN Messenger
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Fri Sep 26, 2008 1:47 pm    Post subject: Reply with quote

You didn't search enough on google...

First thing that came up:

http://bytes.com/forum/thread569468.html

Edit:

Not trying to be mean...

>.<
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Sep 26, 2008 2:58 pm    Post subject: Reply with quote

slovach wrote:
Take a look at:

GetStdHandle
SetConsoleTextAttribute
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Fri Sep 26, 2008 4:26 pm    Post subject: Reply with quote

Code:

void PrintInColor(char *Text)
{
     for (int TempValue = 0; TempValue < strlen(Text); TempValue++)
     {
          if (Text[TempValue] == '\')
          {
               if (Text[TempValue + 1] == 'r')
                    system("color 04");
               else if (Text[TempValue + 1] == 'b')
                    system("color 01");
               TempValue += 2;
          }
          printf("%c", Text[TempValue]);
     }
}

Code:

PrintColor("\\rRED\\bBLUE");


I haven't tried it out, but I made something like this in some console text thingy I made.

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites