当前位置: 首页>>代码示例>>C++>>正文


C++ draw_string函数代码示例

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


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

示例1: draw_lost_fight_message_box

static void
draw_lost_fight_message_box(frame_t *frame, int opponent)
{
	draw_string(1, 10, frame, "Your knights");
	draw_string(1, 20, frame, "just lost the");
	draw_string(1, 30, frame, "fight");
	draw_player_face(18, 8, opponent, frame);
}
开发者ID:ben2s,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例2: draw_1h_since_save_message_box

static void
draw_1h_since_save_message_box(frame_t *frame, int param)
{
	draw_string(1, 10, frame, "One hour passed");
	draw_string(1, 20, frame, "since the last");
	draw_string(1, 30, frame, "saving");
	draw_icon(20, 14, 0x5d, frame);
}
开发者ID:ben2s,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例3: draw_call_to_location_message_box

static void
draw_call_to_location_message_box(frame_t *frame, int param)
{
	draw_string(1, 10, frame, "You wanted me");
	draw_string(1, 20, frame, "to call you to");
	draw_string(1, 30, frame, "this location");
	draw_map_object(20, 14, 0x90, frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例4: draw_emergency_neutral_message_box

static void
draw_emergency_neutral_message_box(frame_t *frame, int param)
{
	draw_string(1, 10, frame, "Emergency");
	draw_string(1, 20, frame, "program");
	draw_string(1, 30, frame, "neutralized");
	draw_map_object(16, 8, map_building_sprite[BUILDING_CASTLE], frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例5: draw_emergency_active_message_box

static void
draw_emergency_active_message_box(frame_t *frame, int param)
{
	draw_string(1, 10, frame, "Emergency");
	draw_string(1, 20, frame, "program");
	draw_string(1, 30, frame, "activated");
	draw_map_object(18, 8, map_building_sprite[BUILDING_CASTLE] + 1, frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例6: draw_call_to_stock_message_box

static void
draw_call_to_stock_message_box(frame_t *frame, int param)
{
	draw_string(1, 10, frame, "You wanted me");
	draw_string(1, 20, frame, "to call you");
	draw_string(1, 30, frame, "to this stock");
	draw_map_object(16, 8, map_building_sprite[BUILDING_STOCK], frame);
}
开发者ID:ben2s,项目名称:freeserf,代码行数:8,代码来源:notification.c

示例7: drawChar

static void
drawChar(Lvns * lvns, int x, int y, int code, int attr)
{
    static int black[] = {
	 COLOR_TRANSPARENT, COLOR_BLACK, COLOR_BLACK, COLOR_BLACK
    };

    static int gray[] = {
	 COLOR_TRANSPARENT, 0x00000006, 0x00000007, 0x0000008
    };

    static int white[] = {
	 COLOR_TRANSPARENT, 0x00000008, 0x0000000c, 0x000000f
    };
#ifdef FONT_PLUS
    if( lvns->font != NULL){
        x += MGL_XOFFSET;
        y += MGL_YOFFSET;
        code--;

        lvnsfont_draw( lvns->font, x + 1, y + 1, code, black);
        if( !attr){
        	lvnsfont_draw( lvns->font, x, y, code, white);
        } else {
        	lvnsfont_draw( lvns->font, x, y, code, gray);
        }
     } else {
#endif /* FONT_PLUS */
    char buf[3];

#if 0
    if (lvns->skip && !attr)
      MglGetEvent(lvns, 1);
#endif

    buf[0] = lvns->leaf_to_euc[code * 2];
    buf[1] = lvns->leaf_to_euc[code * 2 + 1];
    buf[2] = 0;

    x += MGL_XOFFSET;
    y += MGL_YOFFSET;

    set_font(12, 0);

    set_color(COLOR_BLACK);
    draw_string(x + 1, y + 1, buf, DIR_NORTH);
    draw_string(x + 2, y + 1, buf, DIR_NORTH);

    if (!attr) {
	set_color(COLOR_WHITE);
    } else {
	set_color(COLOR_LIGHTGRAY);
    }
    draw_string(x, y, buf, DIR_NORTH);
#ifdef FONT_PLUS
    }
#endif /* FONT_PLUS */
}
开发者ID:catmirrors,项目名称:xlvns,代码行数:58,代码来源:sizuku_etc.c

示例8: draw_mine_empty_message_box

static void
draw_mine_empty_message_box(frame_t *frame, int mine)
{
	draw_string(1, 10, frame, "This mine hauls");
	draw_string(1, 20, frame, "no more raw");
	draw_string(1, 30, frame, "materials");
	draw_map_object(18, 8, map_building_sprite[BUILDING_STONEMINE] + mine,
			frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:9,代码来源:notification.c

示例9: draw_lost_land_message_box

static void
draw_lost_land_message_box(frame_t *frame, int opponent)
{
	draw_string(1, 10, frame, "Because of this");
	draw_string(1, 20, frame, "enemy building");
	draw_string(1, 30, frame, "you lost some");
	draw_string(1, 40, frame, "land");
	draw_player_face(18, 8, opponent, frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:9,代码来源:notification.c

示例10: GameOver

void GameOver(Game * game) {
	clear_screen();
	draw_string((screen_width()/2)-11,screen_height()/2-2,"----------------------");
    draw_string((screen_width()/2)-11,screen_height()/2-1,"|     You Died :(    |");
    draw_string((screen_width()/2)-11,screen_height()/2,  "|   Press Q to Quit  |");
    draw_string((screen_width()/2)-11,screen_height()/2+1,"| Press R to Restart |");
    draw_string((screen_width()/2)-11,screen_height()/2+2,"----------------------");
	show_screen();
}
开发者ID:trjstewart,项目名称:qut-cab202,代码行数:9,代码来源:megamaniac.c

示例11: test_default_command

static int test_default_command(int x, int y)
{
	draw_string(x, y, "ENTER  Save & Exit", DRAW_COLOR_WHITE);
	++y;
	draw_string(x, y, "ESC    Exit", DRAW_COLOR_WHITE);
	++y;

	return y;
}
开发者ID:BirchJD,项目名称:advancemame-0.106.1-RPi,代码行数:9,代码来源:v.c

示例12: info

void info() {
        int x = screen_width()/2;
        draw_string(x - 5, screen_height() -1, "Level: 1" );
        draw_string(0, screen_height()-2, "Georgina Hine (n8872597)");
        draw_string(screen_width() - 9, screen_height() - 2, "Lives:");
        draw_string(screen_width()-18, screen_height() - 2, "Score:"); 
        draw_line(0, screen_height() - 3, screen_width(), screen_height() - 3, '-');
 
        show_screen();
}
开发者ID:micabressan,项目名称:trabajo_final,代码行数:10,代码来源:bue2jsUs.C

示例13: save_edge_overlay

// saves the actual active overlay data to a file.
void save_edge_overlay(void)
{

    char fn[64];
    char msg[64];
    FILE *fd;
    DIR* d;
    int fnum = 0;
    int fr = 0;
    int zoom = 0;
    struct dirent* de;
    static struct utimbuf t;
    // nothing to save? then dont save

    if( !is_buffer_ready() )
    {
        draw_string(0, 0, "No overlay to save.", user_color(conf.osd_color));
        return;
    }

    zoom = shooting_get_zoom();

    // first figure out the most appropriate filename to use
    d = opendir(EDGE_SAVE_DIR);
    if( ! d )
    {
        return;
    }

    while( (de = readdir(d)) )
    {
        fr = get_edge_file_num(de->d_name);
        if( fr > fnum )
        {
            fnum = fr;
        }
    }
    ++fnum; // the highest is set, we use the next one
    get_viewport_size();
    // open the right file
    sprintf(fn, EDGE_SAVE_DIR "/" EDGE_FILE_FORMAT, fnum );
    fd = fopen(fn, "wb");
    if(fd !=NULL)
    {
        // write the data
        fwrite(edgebuf->ptr,edgebuf->ptrLen,1,fd);
        fwrite(&zoom,sizeof(zoom),1,fd);
        fclose(fd);
        t.actime = t.modtime = time(NULL);
        utime(fn, &t);
        sprintf(msg, "Saved as %s",fn);
        draw_string(0, 0, msg, user_color(conf.osd_color));
    }
    closedir(d);
}
开发者ID:de-wolff,项目名称:CHDK,代码行数:56,代码来源:edgeoverlay.c

示例14: main

int main(int argc,char** argv) {
	if (argc < 2) { 
		cout << "usage: ./visualise_face_tracker tracker [video_file]" << endl; 
		return 0;
	}
	
	//load detector model
	face_tracker tracker = load_ft<face_tracker>(argv[1]);

	//create tracker parameters
	face_tracker_params p; 
	p.ssize.resize(3);
	p.ssize[0] = Size(21,21);
	p.ssize[1] = Size(11,11);
	p.ssize[2] = Size(5,5);
	
#ifdef WITH_CUDA
	cout << gpu::getCudaEnabledDeviceCount() << " device(s) found" << endl;
	gpu::setDevice(0);
	gpu::printShortCudaDeviceInfo(cv::gpu::getDevice());
#endif

	//open video stream
	VideoCapture cam; 
	if (argc > 2) cam.open(argv[2]); 
	else cam.open(0);
	if (!cam.isOpened()) {
		cout << "Failed opening video stream." << endl; 
		return 0;
	}
	
	//detect until user quits
	namedWindow("lip tracker");
	Mat im;
	while (cam.isOpened()) {
		if (!paused) {
			cam >> im;
			if (tracker.track(im,p)) tracker.draw(im);
			draw_string(im, "d - redetection");
			draw_string(im, "p - pause", 20);
			tracker.timer.display_fps(im, Point(1, im.rows - 1));
			imshow("lip tracker", im);
		}
		
		int c = waitKey(10);
		if (c == 'q') break;
		else if (c == 'd') {
			tracker.reset();
			paused = false;	
		}
		else if (c == 'p') {
			paused = !paused;
			if (!paused) tracker.reset();
		}
	}
开发者ID:YangWun,项目名称:asm-lips,代码行数:55,代码来源:visualize_face_tracker.cpp

示例15: test_dmfont

static void test_dmfont()
{
    s32 x = 300, y = 200;
    draw_string("baby os, [email protected]",            x, y + 20 * 0, color);
    draw_string("天下事有难易乎?",                         x, y + 20 * 1, color);
    draw_string("为之,则难者亦易矣,不为,则易者亦难矣;", x, y + 20 * 2, color);
    draw_string("人之为学有难易乎?",                       x, y + 20 * 3, color);
    draw_string("学之,则难者亦易矣,不学,则易者亦难矣。", x, y + 20 * 4, color);
    draw_hex(0x12345678,                                    x, y + 20 * 5, color);
    draw_dec(sizeof(u32),                                   x, y + 20 * 6, color);
}
开发者ID:guzhoudiaoke,项目名称:babyos,代码行数:11,代码来源:init.c


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