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


C++ game_display::h方法代码示例

本文整理汇总了C++中game_display::h方法的典型用法代码示例。如果您正苦于以下问题:C++ game_display::h方法的具体用法?C++ game_display::h怎么用?C++ game_display::h使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在game_display的用法示例。


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

示例1: show_title

TITLE_RESULT show_title(game_display& screen, config& tips_of_day)
{
	disableTerrainCache();
	
	free_all_caches();
	
	cursor::set(cursor::NORMAL);

	const preferences::display_manager disp_manager(&screen);
	const hotkey::basic_handler key_handler(&screen);

	const font::floating_label_context label_manager;

	screen.video().modeChanged(); // resets modeChanged value

//	if (background_is_dirty_) 
	{
		draw_background(screen);
	}

	//- Texts for the menu-buttons.
	//- Members of this array must correspond to the enumeration TITLE_RESULT
	static const char* button_labels[] = {
					       //N_("TitleScreen button^Tutorial"),
					       N_("TitleScreen button^Campaign"),
#ifndef FREE_VERSION		
							N_("TitleScreen button^Skirmish"),
					       N_("TitleScreen button^Multiplayer"),
#endif
					       N_("TitleScreen button^Load"),
//					       N_("TitleScreen button^Add-ons"),
//#ifndef DISABLE_EDITOR2
					       //N_("TitleScreen button^Map Editor"),
//#endif
					       //N_("TitleScreen button^Language"),
					       N_("TitleScreen button^Preferences"),
							N_("Sync Saves"),
#ifndef DISABLE_OPENFEINT
							N_("TitleScreen button^OpenFeint"),
#endif
					       N_("TitleScreen button^Help"),
					       //N_("TitleScreen button^Quit"),
								// Only the above buttons go into the menu-frame
								// Next 2 buttons go into frame for the tip-of-the-day:
					       N_("TitleScreen button^Previous"),
					       N_("TitleScreen button^Next"),
					       //N_("TitleScreen button^Help"),
								// Next entry is no button, but shown as a mail-icon instead:
					       //N_("TitleScreen button^Help Wesnoth") 
							};
	//- Texts for the tooltips of the menu-buttons
	static const char* help_button_labels[] = { 
							//N_("Start a tutorial to familiarize yourself with the game"),
						    N_("Start a new single player campaign"),
#ifndef FREE_VERSION
							N_("Play a single scenario against the AI"),
						    N_("Play multiplayer (hotseat or Internet)"),
#endif
						    N_("Load a saved game"),
//						    N_("Download usermade campaigns, eras, or map packs"),
//#ifndef DISABLE_EDITOR2
						    //N_("Start the map editor"),
//#endif
						    //N_("Change the language"),
						    N_("Configure the game's settings"),
							N_("Sync saved games"),
#ifndef DISABLE_OPENFEINT
							N_("Launch the OpenFeint dashboard"),
#endif

							N_("Show Battle for Wesnoth help"),
							//N_("Quit the game"),
						    N_("Show next tip of the day"),
						    //N_("Upload statistics") 
							};

	//static const size_t nbuttons = sizeof(button_labels)/sizeof(*button_labels);
#ifdef FREE_VERSION	
	int nbuttons = 10;
#else
	int nbuttons = 8;
#endif
	
#ifdef DISABLE_OPENFEINT
	nbuttons--;
#endif
	
#ifndef __IPAD__
	nbuttons--;	// because help is off to the left now
#endif
	
	int menu_xbase = CVideo::getx()-108-10; //380; //(game_config::title_buttons_x*screen.w())/1024;
	const int menu_xincr = 0;

#ifdef USE_TINY_GUI
	//const int menu_ybase = 15; //(330*screen.h())/768 - 50; //15;
	const int menu_yincr = 36+5; //(35*3)/4;//15;
	const int menu_ybase = (screen.h() - (36+5)*nbuttons - 5) / 2 + 4;
#else
	const int menu_ybase = (screen.h() - (36+5)*nbuttons - 5) / 2 + 4;
//.........这里部分代码省略.........
开发者ID:dodikk,项目名称:iWesnoth,代码行数:101,代码来源:titlescreen.cpp


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