本文整理汇总了C++中GraphicsObject::width方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsObject::width方法的具体用法?C++ GraphicsObject::width怎么用?C++ GraphicsObject::width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsObject
的用法示例。
在下文中一共展示了GraphicsObject::width方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void ColourFilterObjectData::render(const GraphicsObject& go,
const GraphicsObject* parent,
std::ostream* tree) {
if (go.width() != 100 || go.height() != 100) {
static bool printed = false;
if (!printed) {
printed = true;
cerr << "We can't yet scaling colour filters." << endl;
}
}
// Lazily create colour object.
if (!colour_filer_) {
colour_filer_.reset(graphics_system_.BuildColourFiller(screen_rect_));
}
RGBAColour colour = go.colour();
colour.setAlpha(
static_cast<int>(colour.a_float() * go.computedAlpha()));
colour_filer_->Fill(go, colour);
if (tree) {
*tree << " ColourFilterObjectData" << std::endl
<< " Screen rect: " << screen_rect_ << std::endl
<< " Colour: " << colour << std::endl
<< " Properties: ";
PrintGraphicsObjectToTree(go, tree);
*tree << endl;
}
}
示例2: dstRect
Rect GraphicsObjectData::dstRect(const GraphicsObject& go) {
Point origin = dstOrigin(go);
Rect src = srcRect(go);
int xPos1 = go.x() + go.xAdjustmentSum() - origin.x();
int yPos1 = go.y() + go.yAdjustmentSum() - origin.y();
int xPos2 = int(xPos1 + src.width() * (go.width() / 100.0f));
int yPos2 = int(yPos1 + src.height() * (go.height() / 100.0f));
return Rect::GRP(xPos1, yPos1, xPos2, yPos2);
}
示例3: pixelWidth
int GraphicsObjectOfFile::pixelWidth(const GraphicsObject& rp) {
const Surface::GrpRect& rect = surface_->getPattern(rp.pattNo());
int width = rect.rect.width();
return int((rp.width() / 100.0f) * width);
}