📄 options.c
字号:
/*菜单“选项”中的函数*/
int options1(int *x,int *y);
int DrawButtons3();
int options2(int *x,int *y);
int draw_robot();
int options1(int *x,int *y)
{
int buttons,xmin = 1,xmax = 639,ymin = 1,ymax = 479;
FootballPitch *pitch=malloc(18 * sizeof(char));
InitPitch(pitch);
setwritemode(COPY_PUT);
DrawPitch(pitch);
DrawButtons3();
setwritemode(XOR_PUT);
cursor(*x,*y);
for(;;)
{
newxy(x,y,&buttons);
if(*x > 285 && *x < 355 && *y > 420 && *y < 450 && buttons)
break;
}
free(pitch);
return 0;
}
int options2(int *x,int *y)
{
int buttons,xmin = 1,xmax = 639,ymin = 1,ymax = 479;
setwritemode(COPY_PUT);
draw_robot();
DrawButtons3();
setwritemode(XOR_PUT);
cursor(*x,*y);
for(;;)
{
newxy(x,y,&buttons);
if(*x > 285 && *x < 355 && *y > 420 && *y < 450 && buttons)
break;
}
return 0;
}
int draw_robot()
{
setcolor(WHITE);
settextstyle(0,0,1);
settextjustify(1,1);
setfillstyle(1,LIGHTRED);
bar(300,150,400,250);
bar(310,250,330,280);
bar(390,250,370,280);
setfillstyle(1,RED);
bar(285,160,300,220);
bar(400,160,415,220);
bar(320,110,380,150);
arc(340,130,50,130,10);
arc(360,130,50,130,10);
arc(350,130,230,310,10);
setcolor(LIGHTGRAY);
line(340,110,320,80);
line(360,110,380,80);
outtextxy(350,200,"Du buying");
setcolor(WHITE);
return 0;
}
int DrawButtons3()
{
setfillstyle(1,LIGHTGRAY);
bar(285,420,355,450);
drawmat(tui16S,16,305,430,WHITE);
drawmat(chu16S,16,325,430,WHITE);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -