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


C++ GfxSurface::draw方法代码示例

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


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

示例1: add

void UIElements::add(UIElement *obj) {
	// Add object
	assert(_objList.size() < 12);
	_objList.push_back(obj);

	obj->setPosition(Common::Point(_bounds.left + obj->_position.x, _bounds.top + obj->_position.y));
	obj->reposition();

	GfxSurface s = obj->getFrame();
	s.draw(obj->_position);
}
开发者ID:DieInGame,项目名称:scummvm,代码行数:11,代码来源:user_interface.cpp

示例2: drawFrame

void ModalDialog::drawFrame() {
	Rect origRect = _bounds;
	_bounds.collapse(-10, -10);

	if (g_vm->getGameID() == GType_Ringworld2) {
		GfxElement::drawFrame();
	} else {
		// Fill the dialog area
		g_globals->gfxManager().fillRect(origRect, 54);

		// Draw top line
		GfxSurface surface = surfaceFromRes(8, 1, 7);
		for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
			surface.draw(Common::Point(xp, _bounds.top));
		surface.draw(Common::Point(_bounds.right - 20, _bounds.top));

		surface = surfaceFromRes(8, 1, 1);
		surface.draw(Common::Point(_bounds.left, _bounds.top));

		surface = surfaceFromRes(8, 1, 4);
		surface.draw(Common::Point(_bounds.right - 10, _bounds.top));

		// Draw vertical edges
		surface = surfaceFromRes(8, 1, 2);
		for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
			surface.draw(Common::Point(_bounds.left, yp));
		surface.draw(Common::Point(_bounds.left, _bounds.bottom - 20));

		surface = surfaceFromRes(8, 1, 5);
		for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
			surface.draw(Common::Point(_bounds.right - 10, yp));
		surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 20));

		// Draw bottom line
		surface = surfaceFromRes(8, 1, 8);
		for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
			surface.draw(Common::Point(xp, _bounds.bottom - 10));
		surface.draw(Common::Point(_bounds.right - 20, _bounds.bottom - 10));

		surface = surfaceFromRes(8, 1, 3);
		surface.draw(Common::Point(_bounds.left, _bounds.bottom - 10));

		surface = surfaceFromRes(8, 1, 6);
		surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 10));
	}

	// Set the dialog's manager bounds
	_gfxManager._bounds = origRect;
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:49,代码来源:dialogs.cpp


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