vs2019有easyx,为什么还是未定义标识符“setlinecolor""settextstyle"

0

#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<conio.h>
//#include<cstdio>
void drawMenu()
{
setfillcolor(LIGHTBLUE);
//先画形状
solidrectangle(200, 150, 350, 200);//矩形框x x y y
solidrectangle(200, 210, 350, 210 + 50);
solidrectangle(200, 270, 350, 270 + 50);
//再写字
settextcolor(BLACK);
setbkmode(TRANSPARENT);
settextstyle(35, 0, "宋体");//27:48
outtextxy(200 + 15, 150 + 10, "开始游戏");
outtextxy(200 + 15, 210 + 10, "查看日志");
outtextxy(200 + 15, 260 + 10, "退出游戏");
MOUSEMSG m;//判断鼠标的位置
while (1)
{
m = GetMouseMsg();
if (m.x >= 200 && m.x <= 350 && m.y >= 150 && m.y <= 200)
{
setlinecolor(RED);
rectangle(200 + 5, 150 - 5, 350 + 5, 200 + 5);
settextcolor(BLACK);
outtextxy(200 + 15, 150 + 10, "开始游戏");
if (m.uMsg == WM_LBUTTONDOWN)
{
break;//36:45
}
}
else if (m.x >= 200 && m.x <= 350 && m.y >= 210 && m.y <= 260)
{
setlinecolor(RED);
rectangle(200 + 5, 210 - 5, 350 + 5, 260 + 5);
settextcolor(BLACK);
outtextxy(200 + 15, 210 + 10, "查看日志");
if (m.uMsg == WM_LBUTTONDOWN)
{
exit(0);
}
}
else if (m.x >= 200 && m.x <= 350 && m.y >= 270 && m.y <= 320)
{
setlinecolor(RED);
rectangle(200 + 5, 270 - 5, 350 + 5, 320 + 5);
settextcolor(BLACK);
outtextxy(200 + 15, 260 + 10, "退出游戏");
if (m.uMsg == WM_LBUTTONDOWN)
{
exit(0);
}
}
else//文本框动效
{
setlinecolor(WHITE);
rectangle(200 + 5, 270 - 5, 350 + 5, 320 + 5);
rectangle(200 + 5, 210 - 5, 350 + 5, 260 + 5);
rectangle(200 + 5, 150 - 5, 350 + 5, 200 + 5);
settextcolor(WHITE);
outtextxy(200 + 15, 150 + 10, "开始游戏");
outtextxy(200 + 15, 210 + 10, "查看日志");
outtextxy(200 + 15, 260 + 10, "退出游戏");

}
}
}
int main()
{
initgraph(500, 450);
setbkcolor(WHITE);//背景
cleardevice();
drawMenu();
getchar();
closegraph();
return 0;
}

ava
用户1a5c

2022-6-9

0

到官网下载最新版的 EasyX,自动安装,然后再编译试试。如果还有问题,把具体的错误提示贴出来。

ava
慢羊羊

2022-6-20

技术讨论社区
相关问题