本文整理汇总了C++中cegui::Window::setPixelAligned方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::setPixelAligned方法的具体用法?C++ Window::setPixelAligned怎么用?C++ Window::setPixelAligned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::setPixelAligned方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createScorePopup
void HUDDemo::createScorePopup(const CEGUI::Vector2<float>& mousePos, int points)
{
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* popupWindow = winMgr.createWindow("HUDDemo/PopupLabel");
d_rootIngame->addChild(popupWindow);
popupWindow->setPosition(CEGUI::UVector2(cegui_absdim(mousePos.d_x), cegui_absdim(mousePos.d_y)));
popupWindow->setText(CEGUI::PropertyHelper<int>::toString(points));
popupWindow->setRiseOnClickEnabled(false);
popupWindow->subscribeEvent(AnimationInstance::EventAnimationEnded, Event::Subscriber(&HUDDemo::handleScorePopupAnimationEnded, this));
popupWindow->setPixelAligned(false);
popupWindow->setFont("DejaVuSans-14");
popupWindow->setPosition(popupWindow->getPosition() + CEGUI::UVector2(cegui_reldim(0.03f), cegui_reldim(-0.02f)));
if(points < 0)
popupWindow->setProperty("NormalTextColour", "FF880000");
else
{
popupWindow->setText( "+" + popupWindow->getText());
popupWindow->setProperty("NormalTextColour", "FF006600");
}
CEGUI::EventArgs args;
popupWindow->fireEvent("StartAnimation", args);
}
示例2: spawnPlate
CEGUI::Window* HUDDemo::spawnPlate()
{
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* plateRoot = winMgr.createWindow("DefaultWindow");
plateRoot->setSize(CEGUI::USize(cegui_absdim(0.0f), cegui_reldim(0.16f)));
plateRoot->setAspectMode(CEGUI::AM_EXPAND);
plateRoot->setAspectRatio(1.0f);
plateRoot->setRiseOnClickEnabled(false);
plateRoot->setPixelAligned(false);
plateRoot->subscribeEvent(CEGUI::Window::EventMouseButtonDown, Event::Subscriber(&HUDDemo::handlePlateWindowClicked, this));
d_rootIngame->addChild(plateRoot);
CEGUI::Window* plateImgWnd = winMgr.createWindow("Generic/Image", "ImageWindowPlate");
plateImgWnd->setProperty("Image", s_imageNamePlate);
plateImgWnd->setSize(CEGUI::USize(cegui_reldim(1.0f), cegui_absdim(0.0f)));
plateImgWnd->setAspectRatio(3.308f);
plateImgWnd->setAspectMode(CEGUI::AM_EXPAND);
plateImgWnd->setVerticalAlignment(CEGUI::VA_BOTTOM);
plateImgWnd->setMousePassThroughEnabled(true);
plateImgWnd->setPixelAligned(false);
plateRoot->addChild(plateImgWnd);
CEGUI::String image = getRandomGameImage();
CEGUI::Window* plateTopping = winMgr.createWindow("Generic/Image", "ImageWindowObject");
plateTopping->setProperty("Image", image);
plateTopping->setSize(CEGUI::USize(cegui_reldim(0.88f), cegui_absdim(0.0f)));
plateTopping->setAspectRatio(1.0f);
plateTopping->setAspectMode(CEGUI::AM_EXPAND);
plateTopping->setHorizontalAlignment(CEGUI::HA_CENTRE);
plateTopping->setMousePassThroughEnabled(true);
plateTopping->setPixelAligned(false);
plateRoot->addChild(plateTopping);
int randumNumber = rand() % 10000;
float posY = randumNumber / 10000.0f;
plateRoot->setPosition(CEGUI::UVector2(cegui_absdim(0.0f), cegui_reldim(0.1f + 0.6f * posY)));
return plateRoot;
}