Aug 3, 2013 at 3:16am Aug 3, 2013 at 3:16am UTC
I'm working on a game that uses different colours and I was wondering what is a api or library that could allow me to detect the colours on certain text.
And if it matters Iv'e been using this to change the texts colour
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xC4)
Last edited on Aug 3, 2013 at 3:30am Aug 3, 2013 at 3:30am UTC
Aug 3, 2013 at 3:55am Aug 3, 2013 at 3:55am UTC
If you yourself are setting the text color... why do you need the API to tell you what color it is? Shouldn't you already know since you're the one who set it?
Aug 3, 2013 at 4:06am Aug 3, 2013 at 4:06am UTC
Because Im changing it so i can have the player move the problem is it changes the background colour behind if its not the same one.
Aug 3, 2013 at 4:10am Aug 3, 2013 at 4:10am UTC
Yes... but you already know what kind of background the player is on, right? So with that information you should know what color it should be.
Aug 3, 2013 at 4:31am Aug 3, 2013 at 4:31am UTC
The background is not all the same so I cant tell want background hes on and theres no pattern to it.
Aug 3, 2013 at 4:41am Aug 3, 2013 at 4:41am UTC
Don't worry I did a different method for solving it I was mostly just curious if there was an api for it.
Aug 3, 2013 at 6:02am Aug 3, 2013 at 6:02am UTC
Google "msdn ReadConsoleOutputAttribute" for how to get the color (attribute) of one or more cells in the console display.
Your different method for solving is more likely to be the correct way, however.