本文整理汇总了C++中setOpacity函数的典型用法代码示例。如果您正苦于以下问题:C++ setOpacity函数的具体用法?C++ setOpacity怎么用?C++ setOpacity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOpacity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOpacity
void
CSVGStroke::
setOpacity(const string &opacity_def)
{
double opacity = svg_.decodeOpacityString(opacity_def);
setOpacity(opacity);
}
示例2: setOpacity
void PopUpMenu::logic( double timeElapsed )
{
agui::PopUpMenu::logic(timeElapsed);
if(getOpacity() < 1.0f)
{
setOpacity(getOpacity() + m_opacityRate);
}
}
示例3: Rect
MenuItemSprite* ItemWindowLayer::createMenuItemSprite(Color3B color, const ccMenuCallback& callback)
{
auto rect = Rect(0, 0, 300, 30);
auto capRect = Rect(0, 0, 300, 30);
auto pSprite1 = extension::Scale9Sprite::create("menu_button.png", rect, capRect);
pSprite1->setColor(color);
pSprite1->setOpacity(192);
pSprite1->setContentSize(Size(40, 20));
auto pSprite2 = extension::Scale9Sprite::create("menu_button.png", rect, capRect);
pSprite2->setColor(color);
pSprite2->setOpacity(128);
pSprite2->setContentSize(Size(40, 20));
// 使用ボタン
return MenuItemSprite::create(pSprite1, pSprite2, callback);
}
示例4: setOpacity
void
MCSkillBarItem::coldTimeDidFinish(CCObject *anObject)
{
CCProgressTimer *progressTimer = dynamic_cast<CCProgressTimer *>(anObject);
progressTimer->removeFromParentAndCleanup(true);
setOpacity(kMCSkillBarItemActiveSkillOpacity);
}
示例5: RotationOriginIndicator
RotationOriginIndicator(QGraphicsItem *parent = 0)
: QGraphicsItem(parent)
{
setFlags(QGraphicsItem::ItemIgnoresTransformations |
QGraphicsItem::ItemIgnoresParentOpacity);
setZValue(10000 + 1);
setOpacity(0.5);
}
示例6: CC_CALLBACK_1
bool PencilLayer::init()
{
if (!LayerColor::initWithColor(Color4B::WHITE)) //ÇϾá»ö ¼¼ÆÃ
{
return false;
}
auto winSize = Director::getInstance()->getWinSize();
auto background = MenuItemImage::create(
"Resources/Black.png",
"Resources/Black.png",
CC_CALLBACK_1(PencilLayer::VoidFunc, this));
auto menu0 = Menu::create(background, false);
menu0->setAnchorPoint(Point(0, 0));
menu0->setPosition(winSize.width / 2, winSize.height / 2);
menu0->setOpacity(50);
this->addChild(menu0, 10);
auto exit = MenuItemImage::create(
"Resources/Exit.png",
"Resources/ExitSelected.png",
CC_CALLBACK_1(PencilLayer::menuCallback, this));
auto menu = Menu::create(exit, false);
menu->setPosition(1200, 700);
this->addChild(menu, 13);
Sprite* pencil;
if (Player::getInstance()->IsPencilSharp())
{
pencil = Sprite::create("Resources/Pencil2.png");
}
else if (Player::getInstance()->GetSharpGauge()>=50)
{
pencil = Sprite::create("Resources/Pencil1.png");
}
else
{
pencil = Sprite::create("Resources/Pencil0.png");
}
pencil->setAnchorPoint(Point(0.5, 0));
pencil->setPosition(640, 0);
this->addChild(pencil, 11, "pencil");
auto cuter = Sprite::create("Resources/Cuter.png");
cuter->setAnchorPoint(Point(0.5, 0.5));
cuter->setPosition(800, 400);
this->addChild(cuter,12,"cuter");
auto mouseListener = EventListenerMouse::create();
mouseListener->onMouseMove = CC_CALLBACK_1(PencilLayer::OnMouseMove, this);
mouseListener->onMouseDown = CC_CALLBACK_1(PencilLayer::OnMouseDown, this);
mouseListener->onMouseUp = CC_CALLBACK_1(PencilLayer::OnMouseUp, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);
return true;
}
示例7: readProperties
void OpacityCommand::readProperties(boost::property_tree::wptree& pt)
{
AbstractCommand::readProperties(pt);
if (pt.count(L"opacity") > 0) setOpacity(pt.get<float>(L"opacity"));
if (pt.count(L"duration") > 0) setDuration(pt.get<int>(L"duration"));
if (pt.count(L"tween") > 0) setTween(QString::fromStdWString(pt.get<std::wstring>(L"tween")));
if (pt.count(L"defer") > 0) setDefer(pt.get<bool>(L"defer"));
}
示例8: CC_CALLBACK_1
void HelloWorld::addMenu()
{
Size visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
auto menuItem1 = MenuItemLabel::create(Label::createWithTTF(" Play ", "fonts/airstrikecond.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene, this));
auto menuItem2 = MenuItemLabel::create(Label::createWithTTF(" Setting ", "fonts/airstrikehalf.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene2, this));
auto menuItem3 = MenuItemLabel::create(Label::createWithTTF(" Records ", "fonts/airstrike3d.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene3, this));
auto menuItem4 = MenuItemLabel::create(Label::createWithTTF(" Agregar Persona ", "fonts/airstrike3d.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene4, this));
auto menuItem5 = MenuItemLabel::create(Label::createWithTTF(" ScrollView ", "fonts/airstrike3d.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene5, this));
auto menuItem6 = MenuItemLabel::create(Label::createWithTTF(" PageView ", "fonts/airstrikecond.ttf", 34), CC_CALLBACK_1(HelloWorld::btnNewScene6, this));
auto menuGral = Menu::create(menuItem1,menuItem2,menuItem3,menuItem4, menuItem5,menuItem6,NULL);
menuGral->alignItemsVertically();
auto sprite = Sprite::create("greenChild.jpg");
sprite->setPosition(Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height + sprite->getContentSize().height));
menuGral->setPosition(Point(sprite->getContentSize().width / 2, sprite->getContentSize().height / 2));
sprite->addChild(menuGral);
sprite->setName("menu");
sprite->setOpacity(30);
//MoveBy *accion2 ;
if(i == 0)
{
this->addChild(sprite,2);
MoveBy *accion2 = MoveBy::create(1, Point(0, - ((visibleSize.height / 2) + sprite->getContentSize().height)));
sprite->runAction(accion2);
i++;
}
else if(i>0)
{
this->removeChildByName("menu");
i = 0;
}
}
示例9: setContentSize
bool CCRectNode::initWithSize(const CCSize& tSize, const ccColor4F& tColor, bool bFill)
{
setContentSize(tSize);
setColor(ccc3(tColor.r * 255, tColor.b * 255, tColor.g * 255));
setOpacity(tColor.a * 255);
m_bFill = bFill;
return true;
}
示例10: setOpacity
void QgsRasterRenderer::copyCommonProperties( const QgsRasterRenderer* other )
{
if ( !other )
return;
setOpacity( other->opacity() );
setAlphaBand( other->alphaBand() );
setRasterTransparency( other->rasterTransparency() ? new QgsRasterTransparency( *other->rasterTransparency() ) : nullptr );
}
示例11: setPosition
bool CCLineNode::initWithPoints(const CCPoint& tBeginPoint, const CCPoint& tEndPoint, const ccColor4F& tColor)
{
setPosition(tBeginPoint);
setContentSize(ccpDiff(tEndPoint, tBeginPoint));
setColor(ccc3(tColor.r * 255, tColor.b * 255, tColor.g * 255));
setOpacity(tColor.a * 255);
return true;
}
示例12: setFlag
GraphicsWidgetBase::GraphicsWidgetBase() {
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsFocusable, true);
setAcceptHoverEvents(true);
#if(QT_VERSION >= QT_VERSION_CHECK(4,5,0))
setOpacity(0.8);
#endif
}
示例13: CCLOG
void MainScene::initCollisionSprite() {
CCLOG("CollisionSprite初期化");
auto collisionSprite = Sprite::create();
collisionSprite->setAnchorPoint(Point(0, 0));
collisionSprite->setTextureRect(Rect(0, 0, 640, 100));
collisionSprite->setOpacity(0);
collisionSprite->setPosition(0, 0);
this->addChild(collisionSprite);
}
示例14: setColor
/** A shadow volume only uses a material when it is to be visible during development. */
void CC3ShadowVolumeMeshNode::checkShadowMaterial()
{
if ( !_shouldDrawTerminator && isVisible() )
{
setColor( CCColorRefFromCCC4F(ccc4f(kCC3OneThird, kCC3OneThird, kCC3OneThird, 1.0)) ); // Will lazily init material if needed
setOpacity( (CCOpacity)(kCCOpacityFull * kCC3OneThird) );
} else
setMaterial( NULL );
}
示例15: setVisible
void LongPressSpinner::setGoodPress(bool flag)
{
setVisible(true);
setOpacity(1.0);
prepareGeometryChange();
m_goodPressFlag = flag;
m_goodPressTimer.start();
update();
}