|
-
July 17th, 2010, 10:19 AM
#20
Re: Learning to use Microsoft Visual C++
Thank you everyone!
This is basicly just a mock-up made using C++, but I intend to build on it as I learn more. Unfortunately, the code I'm using is quite clunky and I'm having some trouble. Here's a screenshot!

First and worst - I don't seem to be able to maximise the program (Quests got cut off :P ), if I press maximise it only covers about a third of the screen. :P This is a real pain as it means zero immersion. >.<
Also to turn the key letters red, I had to do this:
Code:
#include <iostream>
#include <string>
#include <windows.h>
Code:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(I) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Inventory - ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(M) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Cast Magic - ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(A) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Actions - ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(C) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Char - "; //cout << Name << -; Character's name inserted with string
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(E) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Equipment - ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
cout << "(Q) ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Quest\n\n";
Which is a pest!
Is there any way to make this a 'standard' piece of code that I can insert like a string? It would be really handy if I could just tack it on with one line of code instead of pasting that whole chunk every time I describe something. Would make things ten times easer! Though if anyone knows a way of changing text colour (can you change font size and style? Times Roman would be easier on the eye.) in the middle of a line that would be just as helpful. Also, is there an include I can do to get symbols like £, €, and (especially) ¥ (yen), to show up (I want to use it as a currency counter)?
Last edited by Ion Zone; July 17th, 2010 at 12:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|