• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ drawstr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中drawstr函数的典型用法代码示例。如果您正苦于以下问题:C++ drawstr函数的具体用法?C++ drawstr怎么用?C++ drawstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了drawstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: level

void level(void){// レベルの表記
  if(a==1) drawstr(win, 5, 485, 18, 0.0, "LV1");// 初期レベル1
  if(a==2) drawstr(win, 5, 485, 18, 0.0, "LV2");
  if(a==3) drawstr(win, 5, 485, 18, 0.0, "LV3");
  if(a==4) drawstr(win, 5, 485, 18, 0.0, "LV4");
  if(a==5) drawstr(win, 5, 485, 18, 0.0, "LV5");// 最高レベル5
}
开发者ID:YugeShunki,项目名称:git,代码行数:7,代码来源:level5.c


示例2: drawPredicates

    void drawPredicates(SkCanvas* canvas, const SkPoint pts[]) {
        SkRegion rgn;
        build_base_rgn(&rgn);

        drawstr(canvas, "Intersects", pts[0], rgn.intersects(fRect));
        drawstr(canvas, "Contains", pts[1], rgn.contains(fRect));
    }
开发者ID:jetlive,项目名称:skiaming,代码行数:7,代码来源:SampleRegion.cpp


示例3: main

int main()
{
    time_t time_now ;
    int win ;
    char d0[8],d1[8],d2[8],d3[8], t0[16] ;

    gsetinitialattributes(ENABLE,DOCK_APPLICATION) ;
    win = gopen(56,56) ;
    layer(win,0,1) ;
    while(1){
	time(&time_now) ;
	sscanf(ctime(&time_now),"%s %s %s %s %s\n",d0,d1,d2,t0,d3) ;
	gclr(win) ;
	newrgbcolor(win,0xff,0xff,0xff) ;
	drawstr(win,4,1, 8 ,0,"%s %s %s",d0,d1,d2) ;
	drawstr(win,4,46, 10 ,0,"%s",t0) ;
	gputimage(win,0,10,Ppmimage,PPM_WIDTH,PPM_HEIGHT,0) ;
	newrgbcolor(win,0x40,0x40,0x40) ;
	moveto(win,0,0) ;
	lineto(win,0,55) ;
	lineto(win,55,55) ;
	newrgbcolor(win,0xe7,0xe7,0xe7) ;
	lineto(win,55,0) ;
	lineto(win,0,0) ;
	copylayer(win,1,0) ;
	msleep(200) ;
    }
    gcloseall() ;
    return(0) ;
}
开发者ID:cyamauch,项目名称:eggx,代码行数:30,代码来源:plamoclock.c


示例4: content

void content()
{
	extern bool SphereInFrustum (float,float,float,float);

	glClear (GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);

	// extract frustum parameter of current camera
	extern void ExtractFrustum();
	ExtractFrustum();

	int nshow = 0;
	for (int i = 0; i < NSPHERES; i++) {
		if (! cull || SphereInFrustum (pos[i][0], pos[i][1],pos[i][2], radius[i])) {
			++nshow;
			glPushMatrix();
				glTranslatef (pos[i][0], pos[i][1], pos[i][2]);
				glutSolidSphere (radius[i], 120,120); 
			glPopMatrix();
		}
	}


	BEGIN_2D_OVERLAY (10,10);
	glDisable(GL_LIGHTING);
	glColor3f (1,1,0);
	if (cull) 	
		drawstr (1,1, "cull [%d|%d]", NSPHERES-nshow, NSPHERES);
	else
		drawstr (1,1, "no cull");
	END_2D_OVERLAY();

	content_count++;
	glutSwapBuffers();
}
开发者ID:terryfeverpitch,项目名称:OpenGL,代码行数:34,代码来源:fps.cpp


示例5: LEVEL4

void LEVEL4(void){//レベル4に出る半分を埋め尽くす円
  if(a==4){//半分を埋め尽くす円
    newpen(win, 4);//色は青
    fillcirc(win, harf_x, harf_y, 200.0, 200.0);
    if(harf_x == 400){//右側の場合の当たり判定	   
      if( (200+5)*(200+5) >
	  (x-400)*(x-400)+(25-harf_y)*(25-harf_y) ){
	gclr(win);
	newpen(win, 1);
	drawstr(win, 150, 250, 24, 0.0, "GAMEOVER");
	msleep(time*30);
	exit(0);	 
      }
    }
    if(harf_x == 0){//左側の場合の当たり判定
      if( (200+5)*(200+5) >
	  (x-0)*(x-0)+(25-harf_y)*(25-harf_y) ){
	gclr(win);
	newpen(win, 1);
	drawstr(win, 150, 250, 24, 0.0, "GAMEOVER");
	msleep(time*30);
	exit(0);
      }
    }
    harf_y-=5;//落下速度
  }
}
开发者ID:YugeShunki,项目名称:git,代码行数:27,代码来源:level5.c


示例6: draw_group_settings

static void draw_group_settings(int x, int y, int UNUSED(width), int UNUSED(height)) {
    setcolor(COLOR_MAIN_TEXT);
    setfont(FONT_SELF_NAME);

    drawstr(x + SCALE(10), y + MAIN_TOP + SCALE(10), GROUP_TOPIC);
    drawstr(x + SCALE(10), y + MAIN_TOP + SCALE(70), GROUP_NOTIFICATIONS);
}
开发者ID:Matsu616,项目名称:uTox,代码行数:7,代码来源:group.c


示例7: strwidth

static const char *draw_text_justified(char *line, rect r, int line_height,
				       int underline, const char *s)
{
    char *j, *k;
    int w, xw, nl, sc, sw, space_width;
    point p;
    int width, height;
    font f;

    space_width = strwidth(current->fnt, " ");
    f = current->fnt;

    for(p=pt(r.x,r.y); (p.y<=r.y+r.height) && (s); p.y+=line_height)
    {
	s = get_next_line(line, r.width, s);

	p.x = r.x;

	for(j=line; (*j!='\0') && isspace(*j); j++)
	    p.x += space_width;
	for (sc=0, k=j; *k!='\0'; k++)
	    if (isspace(*k))
		sc++;
	for (nl=0, --k; (k>=j) && isspace(*k); k--) {
	    if (*k == '\n')
		nl++;
	    *k = '\0';
	    sc--;
	}

	if ((sc==0) || nl || (! s)) {
	    drawstr(p, j);
	    width = strwidth(f, j);
	}
	else {
	    w = strwidth(f, j);
	    sw = space_width + (r.x+r.width-p.x-w)/sc;
	    xw = (r.x+r.width-p.x-w)%sc;

	    for(j=strtok(j," "); j; j=strtok(NULL," "))
	    {
		drawstr(p, j);
		p.x += sw + strwidth(f, j);
		if (xw) {
		    p.x++;
		    xw--;
		}
	    }
	    width = r.width;
	}
	if (underline) {
	    height = p.y+getheight(f)-getdescent(f)+2;
	    drawline(pt(p.x+1, height), pt(p.x+width-1, height));
	}
    }

    return s;
}
开发者ID:Bgods,项目名称:r-source,代码行数:58,代码来源:drawtext.c


示例8: draw_2p_menu_decor

void draw_2p_menu_decor(int pl, int x, int y)
{
	x++;
	drawstr("\\l\\x", 0, x, y-1);
	y += 2;
	setcurs(x-1, y);
	putch(pl+'0');
	drawstr("P\\x\\2m", 0, x, y);
}
开发者ID:gsrr,项目名称:Python,代码行数:9,代码来源:draw2p_menu.c


示例9: setup

void setup()
{
  GD.begin();
  GD.uncompress(RAM_CHR, cp437_chr);
  GD.uncompress(RAM_PAL, cp437_pal);
  drawstr(atxy(0, 0), "Hello");
  drawstr(atxy(10, 2), "This is the cp437 font");
  for (byte i = 0; i < 14; i++) {
    drawstr(atxy(i, 4 + i), " *Gameduino* ");
  }
}
开发者ID:biemme14,项目名称:gdemu,代码行数:11,代码来源:cp437.cpp


示例10: cell_draw

void
cell_draw(cell* cell)
{
    glColor3ub(0, 255, 128);
    if (selection == cell->id) {
        glColor3ub(255, 255, 0);
        drawstr(10, 240, cell->info);
        glColor3ub(255, 0, 0);
    }
    
    drawstr(cell->x, cell->y, cell->format, cell->value);
}
开发者ID:aquatix,项目名称:amaze,代码行数:12,代码来源:projection.c


示例11: main_display

void
main_display(void)
{
    glClearColor(0.8, 0.8, 0.8, 0.0);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glColor3ub(0, 0, 0);
    setfont("helvetica", 12);
    drawstr(GAP, GAP-5, "World-space view");
    drawstr(GAP+sub_width+GAP, GAP-5, "Screen-space view");
    drawstr(GAP, GAP+sub_height+GAP-5, "Command manipulation window");
    glutSwapBuffers();
}
开发者ID:aquatix,项目名称:amaze,代码行数:12,代码来源:projection.c


示例12: helper

void helper()
{
	BEGIN_2D_OVERLAY (ww, wh);
	setfont("9x15", 80);
	
	drawstr(10, 10, "o/O = Show origin.");
	drawstr(10, 30, "r/R = Reset camera position.");
	drawstr(10, 50, "+/- = Change the color in positive/negative halves.");
	drawstr(10, 70, "x/X = Coordinate selection (X or Y).");
	drawstr(10, 90, "c/C = Change the model.");

	END_2D_OVERLAY();
}
开发者ID:terryfeverpitch,项目名称:GLSL,代码行数:13,代码来源:Source.cpp


示例13: fail

void fail(char *msg){
  u8 i=0;
  
  LED_RED=LOW;
  SSN = LOW;
  erasescreen();
  drawstr(1,2,"FATAL ERROR:");
  drawstr(2,2,msg);
  SSN = HIGH;
  for(i=0;i<5;i++)
    sleepMillis(1000);
  //reset();
}
开发者ID:andreas23,项目名称:ZombieGotcha,代码行数:13,代码来源:main.c


示例14: drawadd_content

static void drawadd_content(int x, int y, int width, int height)
{
    setcolor(C_TITLE);
    setfont(FONT_TEXT);
    drawstr(LIST_RIGHT + SCALE * 5, y + SCALE * 5, "Tox ID");

    drawstr(LIST_RIGHT + SCALE * 5, y + SCALE * 29, "Message");

    if(addfriend_status) {
        setfont(FONT_MISC);
        setcolor(C_RED);
        drawtext(LIST_RIGHT + SCALE * 5, y + SCALE * 83, addstatus[addfriend_status - 1].str, addstatus[addfriend_status - 1].length);
    }
}
开发者ID:notadecent,项目名称:uTox,代码行数:14,代码来源:ui.c


示例15: hint

static void hint(void)
{
	BEGIN_2D_OVERLAY (gw, gh);
	
	glPushAttrib (GL_ENABLE_BIT);
	glDisable (GL_LIGHTING);
	glColor3f (0.88, 0.02, 0.89);
	setfont ("9x15",0);
	drawstr (10,gh-20, "r : switch raytrace");
	drawstr (10,gh-40, "t : show the trace");
	drawstr (10,gh-80, "Press '1' or '2' to change mode ");
	drawstr (10,gh-100, "a : AUTO ON/OFF    MODE %d", mode);
	if( _auto ) 
	{
		drawstr (10,gh-60, "+ : SPEED++ / - : SPEED--");
		glColor3f (1, 0.02, 0.02); 
		drawstr (10, gh-120, "AUTO : ON / SPEED = %.3f", omega);
	}
	else
	{
		drawstr (10,gh-60, "+ : clockwise  - : counter clockwise");
		glColor3f (.5, 0.5, 0.5); 
		drawstr (10, gh-120, "AUTO : OFF");
	}
	glPopAttrib();

	END_2D_OVERLAY();
}
开发者ID:terryfeverpitch,项目名称:OpenGL,代码行数:28,代码来源:main.cpp


示例16: drawadd

/* Draw add a friend window */
static void drawadd(int UNUSED(x), int UNUSED(y), int UNUSED(w), int height)
{
    setcolor(C_TITLE);
    setfont(FONT_SELF_NAME);
    drawstr(LIST_RIGHT + SCALE * 5, SCALE * 10, ADDFRIENDS);

    setcolor(C_TITLE);
    setfont(FONT_TEXT);
    drawstr(LIST_RIGHT + SCALE * 5, LIST_Y + SCALE * 5, TOXID);

    drawstr(LIST_RIGHT + SCALE * 5, LIST_Y + SCALE * 29, MESSAGE);

    if(addfriend_status) {
        setfont(FONT_MISC);
        setcolor(C_RED);

        STRING *str;
        switch(addfriend_status) {
        case ADDF_SENT:
            str = SPTR(REQ_SENT); break;
        case ADDF_DISCOVER:
            str = SPTR(REQ_RESOLVE); break;
        case ADDF_BADNAME:
            str = SPTR(REQ_INVALID_ID); break;
        case ADDF_NONAME:
            str = SPTR(REQ_EMPTY_ID); break;
        case ADDF_TOOLONG: //if message length is too long.
            str = SPTR(REQ_LONG_MSG); break;
        case ADDF_NOMESSAGE: //if no message (message length must be >= 1 byte).
            str = SPTR(REQ_NO_MSG); break;
        case ADDF_OWNKEY: //if user's own key.
            str = SPTR(REQ_SELF_ID); break;
        case ADDF_ALREADYSENT: //if friend request already sent or already a friend.
            str = SPTR(REQ_ALREADY_FRIENDS); break;
        case ADDF_BADCHECKSUM: //if bad checksum in address.
            str = SPTR(REQ_BAD_CHECKSUM); break;
        case ADDF_SETNEWNOSPAM: //if the friend was already there but the nospam was different.
            str = SPTR(REQ_BAD_NOSPAM); break;
        case ADDF_NOMEM: //if increasing the friend list size fails.
            str = SPTR(REQ_NO_MEMORY); break;
        case ADDF_UNKNOWN: //for unknown error.
        case ADDF_NONE: //this case must never be rendered, but if it does, assume it's an error
        default:
            str = SPTR(REQ_UNKNOWN); break;
        }

        drawtextmultiline(LIST_RIGHT + SCALE * 5, utox_window_width - BM_SBUTTON_WIDTH - 5 * SCALE, LIST_Y + SCALE * 83, 0, height, font_small_lineheight, str->str, str->length, 0xFFFF, 0, 1);
    }
}
开发者ID:draziw-,项目名称:uTox,代码行数:50,代码来源:ui.c


示例17: drawsettings_content

static void drawsettings_content(int x, int y, int w, int height)
{
    setcolor(C_TITLE);
    setfont(FONT_TEXT);
    drawstr(LIST_RIGHT + SCALE * 5, y + SCALE * 5, "Name");

    drawstr(LIST_RIGHT + SCALE * 5, y + SCALE * 29, "Status Message");

    drawtextrange(LIST_RIGHT + SCALE * 5, width - SCALE * 5, y + SCALE * 64, self.id, sizeof(self.id));

    setfont(FONT_SELF_NAME);

    drawstr(LIST_RIGHT + SCALE * 5, y + SCALE * 54, "Tox ID");

}
开发者ID:notadecent,项目名称:uTox,代码行数:15,代码来源:ui.c


示例18: remake_tree

static void remake_tree(int win, double order, double rt, double ra,
			double rnd, int bgcolor_r, int bgcolor_g,
			int bgcolor_b)
{
  Cdbl z2 = 0 + 0.9 * L / (1 - pow(rt, order + 1)) * I;
  Cdbl z1 = 0;
  int i;
  /* 背景色専用レイヤ */
  layer(win, 0, 2);
  for (i = 0; i < L; i++) {
    newrgbcolor(win, bgcolor_r + 128.0 * i / L,
		bgcolor_g + 128.0 * i / L, bgcolor_b + 128.0 * i / L);
    drawline(win, -L / 2, i, L / 2 - 1, i);
  }
  /* treeのマスク専用レイヤ */
  layer(win, 0, 4);
  gsetbgcolor(win, "#ffffff");
  gclr(win);
  newcolor(win, "#000000");
  btree(win, z1, z2, order, rt, ra, rnd);
  /* treeの専用レイヤ */
  layer(win, 0, 3);
  gsetbgcolor(win, "#003300");
  gclr(win);
  newgcfunction(win, GXandInverted);
  gputarea(win, -L / 2, 0, win, 4, -L / 2, 0, L / 2 - 1, L - 1);
  newgcfunction(win, GXcopy);
  newcolor(win, "white");
  drawstr(win, L / 2 - 180, 4, 14, 0, "Background Color: "
	  "#%02x%02x%02x", bgcolor_r, bgcolor_g, bgcolor_b);
}
开发者ID:cyamauch,项目名称:eggx,代码行数:31,代码来源:snowfall_ctrl.c


示例19: printf

void *b_fonc (void * arg) {

	int is, numero, i,j, m1;

	numero = (int)arg;

	m1 = 20;

	i = m1;

	printf("numero= %d, i=%d \n",numero,i);

	drawstr (30, 125, "_0_", 3);

	drawrec (100,100,100+m1*10,30);

	for (j=1;j<=m1;j++) {

		printf("num %d j=%d\n",numero,j);
		fillrec (100,102,100+j*10,26,"yellow");
		usleep(70000);
		
	}

	flushdis ();

	return ( (void *)(numero+100) );
}
开发者ID:jjehanne,项目名称:SR02,代码行数:28,代码来源:bar.c


示例20: get_next_line

static const char *draw_text_left(char *line, rect r, int line_height,
				  int underline, const char *s)
{
    char *k;
    point p;
    int width, height;
    font f;

    f = current->fnt;

    for(p=pt(r.x,r.y); (p.y<=r.y+r.height) && (s); p.y+=line_height)
    {
	s = get_next_line(line, r.width, s);

	for (k=line; *k!='\0'; k++)
	    continue;
	for (--k; (k>=line) && isspace(*k); k--)
	    *k = '\0';

	drawstr(p, line);

	if (underline) {
	    width = strwidth(f, line);
	    height = p.y+getheight(f)-getdescent(f)+2;
	    drawline(pt(p.x+1, height), pt(p.x+width-1, height));
	}
    }

    return s;
}
开发者ID:Bgods,项目名称:r-source,代码行数:30,代码来源:drawtext.c



注:本文中的drawstr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ drawtext函数代码示例发布时间:2022-05-30
下一篇:
C++ drawgfx_transpen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap