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


C++ twindow::insert_animation方法代码示例

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


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

示例1: pre_show


//.........这里部分代码省略.........
		}
		std::string str;
		if (!strcmp(menu_items[item], "player")) {
			str = player_hero_.image(true);

		} else if (!strcmp(menu_items[item], "signin")) {
			if (group.signin().today) {
				str = std::string("icons/") + "signin-ok" + ".png";
			} else {
				str = std::string("icons/") + "signin" + ".png";
			}

		} else {
			if (!strcmp(menu_items[item], "message")) {
				if (group.message_count()) {
					b->set_label("misc/red-dot12.png");
				}
			}
			str = std::string("icons/") + menu_items[item] + ".png";
		}

		for (int i = 0; i < 4; i ++) {
			b->canvas()[i].set_variable("image", variant(str));
		}
	}

	if (game_config::tiny_gui) {
		b = find_widget<tbutton>(&window, "design", false, false);
		if (b) {
			b->set_visible(twidget::INVISIBLE);
		}
		b = find_widget<tbutton>(&window, "editor", false, false);
		if (b) {
			b->set_visible(twidget::INVISIBLE);
		}

	} else if (!preferences::developer()) {
		b = find_widget<tbutton>(&window, "design", false, false);
		if (b) {
			b->set_visible(twidget::INVISIBLE);
		}
	}

#if defined(__APPLE__) && TARGET_OS_IPHONE
	b = find_widget<tbutton>(&window, "quit", false, false);
	if (b) {
		b->set_visible(twidget::INVISIBLE);
	}
#endif

	for (int item = 0; item < nb_items; item ++) {
		std::string id = menu_items[item];
		int retval = twindow::NONE;
		if (id == "editor") {
			retval = START_MAP_EDITOR;
		} else if (id == "quit") {
			retval = QUIT_GAME;
		} else if (id == "help") {
			retval = HELP;
		} else if (id == "campaign") {
			retval = NEW_CAMPAIGN;
		} else if (id == "player") {
			retval = PLAYER;
		} else if (id == "side") {
			retval = PLAYER_SIDE;
		} else if (id == "multiplayer") {
			retval = MULTIPLAYER;
		} else if (id == "load") {
			retval = LOAD_GAME;
		} else if (id == "report") {
			retval = REPORT;
		} else if (id == "language") {
			retval = CHANGE_LANGUAGE;
		} else if (id == "message") {
			retval = MESSAGE;
		} else if (id == "preferences") {
			retval = EDIT_PREFERENCES;
		} else if (id == "signin") {
			retval = SIGNIN;
		} else if (id == "shop") {
			retval = INAPP_PURCHASE;
		}

		connect_signal_mouse_left_click(
			find_widget<tbutton>(&window, id, false)
			, boost::bind(
				&ttitle_screen::set_retval
				, this
				, boost::ref(window)
				, retval));
	}

	tlobby::thandler::join();

	config cfg;
	cfg["id"] = anim2::rfind(anim2::TITLE_SCREEN);
	cfg["width"] = 1600;
	cfg["height"] = 900;
	window.insert_animation(cfg, false);
}
开发者ID:freeors,项目名称:War-Of-Kingdom,代码行数:101,代码来源:title_screen.cpp


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