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


C++ OverlayContainer::getLeft方法代码示例

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


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

示例1: reposContainer

void GUIHelper::reposContainer(Ogre::OverlayContainer *o)
{
	ASSERT(o);
	if(!o->getParent()){
		debugWARNING("This overlay has no parent (%s)\n", o->getName().c_str());
		return;
	}
	// if we have parent then we call the other function
	Ogre::OverlayContainer *parent = o->getParent();
	reposContainer(o, parent->getLeft(), parent->getTop(),parent->getHeight(),
			parent->getWidth());
}
开发者ID:agudpp,项目名称:CordobaZombie,代码行数:12,代码来源:GUIHelper.cpp

示例2: fixOverlayPosition

/**
 * Bugfix for the nested overlay containers position. This function will
 * get a overlay and will iterate over all the (child) containers and will
 * set the new "relative" position
 * @param	overlay		The overlay to fix the childs positions
 */
void GUIHelper::fixOverlayPosition(Ogre::Overlay *overlay)
{
	ASSERT(overlay);

	Ogre::Overlay::Overlay2DElementsIterator it = overlay->get2DElementsIterator();

	Ogre::OverlayContainer *parent = 0;
	while(it.hasMoreElements()){
		parent = it.peekNext();
		if(!parent){
			break;
		}

		// else we have the parent... get the top left and sizes
		Ogre::Real top = parent->getTop();
		Ogre::Real left = parent->getLeft();
		Ogre::Real height = parent->getHeight();
		Ogre::Real width = parent->getWidth();


		Ogre::OverlayContainer::ChildIterator it2 = parent->getChildIterator();
		Ogre::OverlayContainer *child = 0;
		while(it2.hasMoreElements()){
			child = static_cast<Ogre::OverlayContainer *>(it2.peekNextValue());
			if(!child){
				break;
			}
			// else.. we have to configure this child with the parent size and
			// position
			reposContainer(child, left, top, height, width);

			it2.moveNext();
		}


		it.moveNext();
	}
}
开发者ID:agudpp,项目名称:CordobaZombie,代码行数:44,代码来源:GUIHelper.cpp

示例3: getAbsoluteGeometry

/**
 * Get the absolute position of the container
 * @param	cont	The container
 * @param	top		The absolute top
 * @param	left	The absolute left
 * @param	w		The absolute width
 * @param	h		The absolute height
 */
void GUIHelper::getAbsoluteGeometry(Ogre::OverlayContainer *cont, Ogre::Real &top,
		Ogre::Real &left, Ogre::Real &right, Ogre::Real &bottom)
{
	ASSERT(cont);
	Ogre::OverlayContainer *parnet = cont->getParent();
	if(parnet){
		if(parnet->getParent()){
			debugWARNING("TODO: tenemos que contemplar este caso... en el que "
					"haya mas de un parnet... tendriamos que calcular recursivamente"
					" las posiciones...\n");
			ASSERT(false);
		}
		top = cont->getTop() + parnet->getTop();
		left = cont->getLeft() + parnet->getLeft();
		right = left + cont->getWidth();
		bottom = top + cont->getHeight();
	} else {
		top = cont->getTop();
		left = cont->getLeft();
		right = left + cont->getWidth();
		bottom = top + cont->getHeight();
	}

}
开发者ID:agudpp,项目名称:CordobaZombie,代码行数:32,代码来源:GUIHelper.cpp


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