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


C++ ZMap::GetViewShiftFull方法代码示例

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


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

示例1: DoRender

void ZVote::DoRender(ZMap &the_map)
{
	if(in_progress && vote_in_progress_img.GetBaseSurface())
	{
		int shift_x, shift_y, view_w, view_h;

		int x, y;

		the_map.GetViewShiftFull(shift_x, shift_y, view_w, view_h);

		x = view_w - vote_in_progress_img.GetBaseSurface()->w;
		//y = view_h - vote_in_progress_img.GetBaseSurface()->h;

		x -= 4;
		y = 4;

		x += shift_x;
		y += shift_y;

		vote_in_progress_img.SetAlpha(200);
		description_img.SetAlpha(200);
		have_img.SetAlpha(200);
		needed_img.SetAlpha(200);
		for_img.SetAlpha(200);
		against_img.SetAlpha(200);

		the_map.RenderZSurface(&vote_in_progress_img, x, y);

		//the_map.RenderZSurface(&description_img, x+7, y+37, false, true);
		the_map.RenderZSurface(&description_img, x+57, y+36+5, false, true);

		the_map.RenderZSurface(&have_img, x+57, y+46+7, false, true);
		the_map.RenderZSurface(&needed_img, x+57, y+57+7, false, true);
		the_map.RenderZSurface(&for_img, x+22, y+57+7, false, true);
		the_map.RenderZSurface(&against_img, x+91, y+57+7, false, true);
	}
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:37,代码来源:zvote.cpp

示例2: DoRender

void GWFactoryList::DoRender(ZMap &the_map, SDL_Surface *dest)
{
	int shift_x, shift_y, view_w, view_h;
	int tx, ty;

	if(!show) return;
	if(!finished_init) return;
	if(!ols) return;
	if(our_team == NULL_TEAM) return;

	the_map.GetViewShiftFull(shift_x, shift_y, view_w, view_h);

	x = shift_x;
	y = shift_y + view_h;

	DetermineHeight(view_h);

	y -= height;

	//top
	the_map.RenderZSurface(&main_top_img, x, y);

	//entries
	DoRenderEntries(the_map, dest);

	//right
	{
		tx = x + (main_top_img.GetBaseSurface()->w - main_right_img.GetBaseSurface()->w);
		ty = y + main_top_img.GetBaseSurface()->h;

		while(ty < shift_y + view_h)
		{
			the_map.RenderZSurface(&main_right_img, tx, ty);
			ty += main_right_img.GetBaseSurface()->h;
		}
	}

	if(entry_list.size())
	{
		int scroll_top;
		int scroll_bottom;
		int scroll_missing_entries;

		//buttons
		up_button.SetOffsets(123, main_top_img.GetBaseSurface()->h + 2);
		up_button.DoRender(the_map, dest, x, y);

		down_button.SetOffsets(123, height - 11);
		down_button.DoRender(the_map, dest, x, y);

		//scrollbar
		scroll_top = main_top_img.GetBaseSurface()->h + 14;
		scroll_bottom = height - 14;
		scroll_bar.SetOffsets(123, scroll_top);
		scroll_bar.SetHeight(scroll_bottom - scroll_top);

		scroll_missing_entries = entry_list.size() - show_able_entries;
		if(scroll_missing_entries > 0)
			scroll_bar.SetPercentDown(1.0 * show_start_entry / scroll_missing_entries);
		else
			scroll_bar.SetPercentDown(0);
		scroll_bar.SetPercentViewable(1.0 * show_able_entries / entry_list.size());

		scroll_bar.DoRender(the_map, dest, x, y);
	}
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:66,代码来源:gwfactory_list.cpp


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