|
Home > Archive > Unix Programming > April 2006 > how to draw the grahic ,ncurses
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to draw the grahic ,ncurses
|
|
| DaVinci 2006-04-27, 7:55 am |
| I want to draw a grahic using ncurse,but met some problem.
printw("\n
_____ _____ _
|_ _|____ _|_ _| __(_)___
| |/ _ \\ \\/ / | || '__| / __|
| | __/> < | || | | \\__ \\
|_|\\___/_/\\_\\ |_||_| |_|___/\n\n\n\n
\t 1) New game
\t 2) High Scores
\t 3) Help
\t 4) Exit
")
this function can't work.I think it is the problem of the quote marks "
",which didn't
include the graphic properly.
how to change it?
thanks very much .
| |
| DaVinci 2006-04-27, 7:55 am |
|
DaVinci wrote:
> I want to draw a grahic using ncurse,but met some problem.
> printw("\n
> _____ _____ _
> |_ _|____ _|_ _| __(_)___
> | |/ _ \\ \\/ / | || '__| / __|
> | | __/> < | || | | \\__ \\
> |_|\\___/_/\\_\\ |_||_| |_|___/\n\n\n\n
> \t 1) New game
> \t 2) High Scores
> \t 3) Help
> \t 4) Exit
>
> ")
> this function can't work.I think it is the problem of the quote marks "
> ",which didn't
> include the graphic properly.
> how to change it?
> thanks very much .
I think I had solve it now. at least there are two way to solve it.
one looks like this:
#include <iostream>
#include <ncurses.h>
#include <string>
void graphic()
{
std::string s ="\n\
_____ _____ \n\
|_ _|____ _|_ _| __(_)___ \n\
| |/ _ / / | || '__| / __| \n\
| | __/> < | || | | __ \n\
| _|___/_/_ |_||_| |_|___/ \n\
1) New game \n\
2) High Scores\n\
3) Help\n\
4) Exit ";
printw("%s",s.c_str());
}
int main()
{
initscr();
refresh();
graphic();
getch();
endwin();
}
the other is using mvprint to print each line which include only line
charcter.
|
|
|
|
|