本文整理汇总了C++中Rect2D::x1方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect2D::x1方法的具体用法?C++ Rect2D::x1怎么用?C++ Rect2D::x1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect2D
的用法示例。
在下文中一共展示了Rect2D::x1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPopup
Rect2D App::drawPopup(const char* title) {
int w = renderDevice->width();
int h = renderDevice->height();
// Drop shadow
renderDevice->pushState();
renderDevice->setBlendFunc(RenderDevice::BLEND_SRC_ALPHA, RenderDevice::BLEND_ONE_MINUS_SRC_ALPHA);
Rect2D rect = Rect2D::xywh(w/2 - 20, h/2 - 20, w/2, h/2);
Draw::rect2D(rect + Vector2(5, 5), renderDevice, Color4(0, 0, 0, 0.15f));
renderDevice->popState();
// White box
Draw::rect2D(rect, renderDevice, Color3::white());
Draw::rect2DBorder(rect, renderDevice, Color3::black());
// The close box
Draw::rect2DBorder(Rect2D::xywh(rect.x1() - 16, rect.y0(), 16, 16), renderDevice, Color3::black());
renderDevice->setColor(Color3::black());
renderDevice->beginPrimitive(PrimitiveType::LINES);
renderDevice->sendVertex(Vector2(rect.x1() - 14, rect.y0() + 2));
renderDevice->sendVertex(Vector2(rect.x1() - 2, rect.y0() + 14));
renderDevice->sendVertex(Vector2(rect.x1() - 2, rect.y0() + 2));
renderDevice->sendVertex(Vector2(rect.x1() - 14, rect.y0() + 14));
renderDevice->endPrimitive();
float s = w * 0.013;
titleFont->draw2D(renderDevice, title, Vector2(rect.x0() + 4, rect.y0()), s * 1.5, Color3::black(), Color4::clear(), GFont::XALIGN_LEFT, GFont::YALIGN_TOP);
return rect;
}
示例2: setDimensions
void GlutWindow::setDimensions(const Rect2D& dims) {
setPosition((int)dims.x0(), (int)dims.x1());
glutReshapeWindow((int)dims.width(), (int)dims.height());
}