本文整理汇总了C++中menu::grid方法的典型用法代码示例。如果您正苦于以下问题:C++ menu::grid方法的具体用法?C++ menu::grid怎么用?C++ menu::grid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::grid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void menu::imgsel_style::draw_row(menu& menu_ref, const size_t row_index, const SDL_Rect& rect, ROW_TYPE type)
{
if(!load_failed_) {
//draw item inside
style::draw_row(menu_ref, row_index, rect, type);
if (type == SELECTED_ROW) {
// draw border
surface image;
SDL_Rect area;
SDL_Rect clip = rect;
area.x = rect.x;
area.y = rect.y;
image = img_map_["border-top"];
area.x = rect.x;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.x += image->w;
} while( area.x < rect.x + rect.w );
image = img_map_["border-left"];
area.x = rect.x;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.y += image->h;
} while( area.y < rect.y + rect.h );
image = img_map_["border-right"];
area.x = rect.x + rect.w - thickness_;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.y += image->h;
} while( area.y < rect.y + rect.h );
image = img_map_["border-bottom"];
area.x = rect.x;
area.y = rect.y + rect.h - thickness_;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.x += image->w;
} while( area.x < rect.x + rect.w );
image = img_map_["border-topleft"];
area.x = rect.x;
area.y = rect.y;
menu_ref.video().blit_surface(area.x,area.y,image);
image = img_map_["border-topright"];
area.x = rect.x + rect.w - image->w;
area.y = rect.y;
menu_ref.video().blit_surface(area.x,area.y,image);
image = img_map_["border-botleft"];
area.x = rect.x;
area.y = rect.y + rect.h - image->h;
menu_ref.video().blit_surface(area.x,area.y,image);
image = img_map_["border-botright"];
area.x = rect.x + rect.w - image->w;
area.y = rect.y + rect.h - image->h;
menu_ref.video().blit_surface(area.x,area.y,image);
} else if (type == NORMAL_ROW && menu_ref.grid()) {
// draw border
surface image;
SDL_Rect area;
SDL_Rect clip = rect;
area.x = rect.x;
area.y = rect.y;
image = img_map_["n-border-top"];
area.x = rect.x;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.x += image->w;
} while( area.x < rect.x + rect.w );
image = img_map_["n-border-left"];
area.x = rect.x;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.y += image->h;
} while( area.y < rect.y + rect.h );
image = img_map_["n-border-right"];
area.x = rect.x + rect.w - thickness_;
area.y = rect.y;
do {
menu_ref.video().blit_surface(area.x,area.y,image,NULL,&clip);
area.y += image->h;
} while( area.y < rect.y + rect.h );
/*
image = img_map_["n-border-bottom"];
area.x = rect.x;
//.........这里部分代码省略.........