本文整理汇总了C++中draw_string函数的典型用法代码示例。如果您正苦于以下问题:C++ draw_string函数的具体用法?C++ draw_string怎么用?C++ draw_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了draw_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: draw_call_to_menu_message_box
static void
draw_call_to_menu_message_box(frame_t *frame, int menu)
{
const int map_menu_sprite[] = {
0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xeb, 0x12a, 0x12b
};
draw_string(1, 10, frame, "You wanted me");
draw_string(1, 20, frame, "to call you");
draw_string(1, 30, frame, "to this menu");
draw_icon(18, 8, map_menu_sprite[menu], frame);
}
开发者ID:Radderz81,项目名称:freeserf,代码行数:13,代码来源:notification.c
示例17: show_menu_line
static void show_menu_line(Menu *m, int x, int y, int w) {
int hx = x, hw = 0;
draw_string(x, y, m->label, w);
if (m->num_opts > 0) {
m->cur_opt %= m->num_opts;
hx = x + 24;
hw = strlen(m->options[m->cur_opt]) + 2;
if (hw > ((x + w) - hx))
hw = (x + w) - hx;
draw_char(hx, y, '[');
draw_string(hx + 1, y, m->options[m->cur_opt], hw);
draw_char(hx + hw - 1, y, ']');
}
}
开发者ID:CrashSerious,项目名称:PS3Roar,代码行数:14,代码来源:ui_gp32.c
示例18: draw_string_shadowed
int draw_string_shadowed (int x, int y, const unsigned char * our_string, int max_lines, float fr,float fg,float fb, float br,float bg,float bb)
{
int px,py,r;
//set shadow colour
glColor3f(br, bg, bb);
for(px=-1;px<2;px++)
for(py=-1;py<2;py++)
if(px!=0 || py!=0)
r=draw_string(x+px, y+py, our_string, max_lines);
//set foreground colour
glColor3f(fr, fg, fb);
r=draw_string(x, y, our_string, max_lines);
return r;
}
开发者ID:bsmr-c-cpp,项目名称:other-life,代码行数:14,代码来源:font.c
示例19: gui_debug_draw_values
//-------------------------------------------------------------------
static void gui_debug_draw_values(const coord y, void* addr) {
int i;
if ((addr<=(void*)camera_info.maxramaddr || addr>=(void*)camera_info.rombaseaddr))
{
sprintf(buf, "0x%08X (%10u)", *((unsigned int*)addr), *((unsigned int*)addr));
draw_string(10*FONT_WIDTH, y, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
sprintf(buf, "0x%04X ( %5hu)", *((unsigned short*)addr), *((unsigned short*)addr));
draw_string(10*FONT_WIDTH, y+FONT_HEIGHT, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
sprintf(buf, "0x%02X ( %3hu)", *((unsigned char*)addr), *((unsigned char*)addr));
draw_string(10*FONT_WIDTH, y+2*FONT_HEIGHT, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
for (i=0; i<30; ++i) {
if (*((char*)(addr+i))) buf[i]=*((char*)(addr+i));
else break;
}
while (i<30) {
buf[i++]=' ';
}
buf[i]=0;
draw_string(10*FONT_WIDTH, y+3*FONT_HEIGHT, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
}
else
{
draw_string(10*FONT_WIDTH, y, bad_address, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
draw_string(10*FONT_WIDTH, y+FONT_HEIGHT, bad_address, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
draw_string(10*FONT_WIDTH, y+2*FONT_HEIGHT, bad_address, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
draw_string(10*FONT_WIDTH, y+3*FONT_HEIGHT, bad_address, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
}
}
开发者ID:adongy,项目名称:ixus160_elph160,代码行数:33,代码来源:gui_debug.c
示例20: gui_calendar_initial_draw
//-------------------------------------------------------------------
static void gui_calendar_initial_draw() {
int x, i;
draw_rectangle(camera_screen.disp_left, 0, camera_screen.disp_right, camera_screen.height-1, MAKE_COLOR(COLOR_BLACK, COLOR_BLACK), RECT_BORDER0|DRAW_FILLED);
draw_string(camera_screen.disp_left+FONT_WIDTH, 0, lang_str(LANG_CALENDAR_TODAY), MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
draw_rectangle(cal_x-3, cal_y-3, cal_x+cal_w+2, cal_y+cal_h+2, CALENDAR_COLOR, RECT_BORDER1);
draw_rectangle(cal_x-1, cal_y-1, cal_x+cal_w, cal_y+FONT_HEIGHT+8, TITLE_COLOR, RECT_BORDER1|DRAW_FILLED);
draw_rectangle(cal_x-1, cal_y+FONT_HEIGHT+8, cal_x+cal_w, cal_y+cal_h, CALENDAR_COLOR, RECT_BORDER1|DRAW_FILLED);
draw_rectangle(cal_x+cal_w-FONT_WIDTH*4*2, cal_y+FONT_HEIGHT+8+1, cal_x+cal_w-1, cal_y+cal_h-1, MAKE_COLOR(BG_COLOR(WEEKEND_COLOR), BG_COLOR(WEEKEND_COLOR)), RECT_BORDER0|DRAW_FILLED);
for (x=cal_x+FONT_WIDTH/2, i=0; i<7; x+=FONT_WIDTH*4, ++i) {
draw_string(x, cal_y+4+FONT_HEIGHT+4+4, lang_str(days[i]), (i<5)?CALENDAR_COLOR:WEEKEND_COLOR);
}
}
开发者ID:adongy,项目名称:ixus160_elph160,代码行数:15,代码来源:gui_calendar.c
注:本文中的draw_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论