本文整理汇总了C++中gfx::Rect::getOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::getOrigin方法的具体用法?C++ Rect::getOrigin怎么用?C++ Rect::getOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gfx::Rect
的用法示例。
在下文中一共展示了Rect::getOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
void ExtraCel::create(doc::Sprite* sprite,
const gfx::Rect& bounds,
doc::frame_t frame,
int opacity)
{
ASSERT(sprite);
if (!m_image ||
m_image->pixelFormat() != sprite->pixelFormat() ||
m_image->width() != bounds.w ||
m_image->height() != bounds.h) {
if (!m_imageBuffer)
m_imageBuffer.reset(new doc::ImageBuffer(1));
doc::Image* newImage = doc::Image::create(sprite->pixelFormat(),
bounds.w, bounds.h,
m_imageBuffer);
m_image.reset(newImage);
}
if (!m_cel) {
// Ignored fields for this cel (frame, and image index)
m_cel.reset(new doc::Cel(doc::frame_t(0), doc::ImageRef(nullptr)));
}
m_cel->setPosition(bounds.getOrigin());
m_cel->setOpacity(opacity);
m_cel->setFrame(frame);
}
示例2: prepareExtraCel
void Document::prepareExtraCel(const gfx::Rect& bounds, int opacity)
{
ASSERT(sprite() != NULL);
if (!m_extraImage ||
m_extraImage->pixelFormat() != sprite()->pixelFormat() ||
m_extraImage->width() != bounds.w ||
m_extraImage->height() != bounds.h) {
Image* newImage = Image::create(sprite()->pixelFormat(), bounds.w, bounds.h);
m_extraImage.reset(newImage);
}
if (!m_extraCel)
m_extraCel = new Cel(frame_t(0), ImageRef(NULL)); // Ignored fields for this cel (frame, and image index)
m_extraCel->setPosition(bounds.getOrigin());
m_extraCel->setOpacity(opacity);
}