| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1333 人关注过本帖
标题:请问如何写界面??
只看楼主 加入收藏
百丙丙丙丙度
Rank: 1
等 级:新手上路
帖 子:43
专家分:0
注 册:2013-8-14
结帖率:100%
收藏
 问题点数:0 回复次数:1 
请问如何写界面??
请问如何写界面??
我听别人说写C课设开始要写界面
不过我看别人写的界面要用到很多宏定义,结构等数据,而我一开始根本不知道有这个
那怎么写
有没有大神知道写界面的具体步骤!!!
写小游戏时的开始界面和主菜单界面
DOS下
比方说
//#include<graphics.h>
#include"bk2.h"

void bk2(GCBDatatype *PGCB)       //画主菜单界面的背景。
{
    int a=getmaxy();
    int i,j;
    float x=0;     //the following will use it because it's float.
    j=PGCB->choose;
    setbkcolor(1);
    cleardevice();
    moveto(32.5,15*sin(PI/2)+30);
    for(i=35;i<=590;i+=1)        //画主菜单界面中的正弦线。
    {
        setcolor(14);
        lineto(i+x,15*sin((i+x-20)/8)+30);      //将其连成线段是方便填色。
    }
    moveto(32.5,15*sin(PI/2)+30);
    for(i=35;i<320;i++)
    {
        setcolor(14);
        lineto(15*sin((i+x-20)/8)+30,i+x);
    }
    for(i=35;i<590;i+=1)
    {
           setcolor(14);
        lineto(i+x,15*sin((i+x-20)/8)+320);
    }
    for(i=320;i>37;i--)
    {
        setcolor(14);
        lineto(15*sin((i+x-20)/8)+590,i+x);
    }
    lineto(590+x,15*sin((590+x-20)/8)+30);
    setfillstyle(1,13);
    floodfill(0,0,14);
    setcolor(4);
    setfillstyle(1,4);
    circle(310,50,10);
    floodfill(310,50,4);
    PGCB->graph_data.ButtonProperty.button_in_use=7;
    setfillstyle(1,9);
    if(j==0)
    {
        bar(60,a/4-10,220,a/4+40);
    }
    else if(j==1)
    {
        bar(230,a/4-10,390,a/4+40);   
    }
    else if(j==2)
    {
        bar(410,a/4-10,570,a/4+40);   
    }
    else if(j==3)
    {
        bar(60,a/2-10,220,a/2+40);   
    }
    else if(j==4)
    {
        bar(230,a/2-10,390,a/2+40);   
    }
    else if(j==5)
    {
        bar(410,a/2-10,570,a/2+40);   
    }
    else if(j==6)
    {
        bar(340,a*3/4-10,500,a*3/4+40);   
    }
    outhzxy(70,a/4,"瞄准模式",4,1);
    anniu(PGCB,60,a/4-10,160,50,0);
    outhzxy(240,a/4,"反应模式",4,1);
    anniu(PGCB,230,a/4-10,160,50,1);
    outhzxy(420,a/4,"判断模式",4,1);
    anniu(PGCB,410,a/4-10,160,50,2);
    outhzxy(70,a/2,"游戏设置",4,1);
    anniu(PGCB,60,a/2-10,160,50,3);
    outhzxy(240,a/2,"游戏帮助",4,1);
    anniu(PGCB,230,a/2-10,160,50,4);
    outhzxy(420,a/2,"最高分数",4,1);
    anniu(PGCB,410,a/2-10,160,50,5);
    outhzxy(350,a*3/4,"退出游戏",4,1);
    anniu(PGCB,340,a*3/4-10,160,50,6);
    for(i=0;i<PGCB->graph_data.ButtonProperty.button_in_use;i++)
    {
        PGCB->graph_data.ButtonProperty.buttons[i].b_condition=0;
    }
    PGCB->graph_data.ButtonProperty.buttons[j].b_condition=1;
    setlinestyle(0,0,1);
}

但是像PGCB->graph_data.ButtonProperty.buttons[0].b_condition
GCBDatatype *PGCB
种东西
开始写根本还不到
我看它的定义是很长的一堆结果之类的
我最开始写怎么知道
难道是先写了
最后在统一改过来
还有就是画图可以慢慢画
界面中button怎么弄的?????
struct button{
int x;
int y;
int x1;
int y1;
int stage;
}BUTTON;
高亮是什么意思
搜索更多相关主题的帖子: following 具体步骤 because include 小游戏 
2013-08-14 14:46
zhaoya881010
Rank: 9Rank: 9Rank: 9
来 自:芒砀古郡
等 级:蜘蛛侠
威 望:1
帖 子:339
专家分:1177
注 册:2010-11-21
收藏
得分:0 
写界面不建议还用c搞

Go Go Go
2013-08-24 10:34
快速回复:请问如何写界面??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014383 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved