• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setOpacity函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setOpacity函数的典型用法代码示例。如果您正苦于以下问题:C++ setOpacity函数的具体用法?C++ setOpacity怎么用?C++ setOpacity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setOpacity函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setOpacity

void
CSVGStroke::
setOpacity(const string &opacity_def)
{
  double opacity = svg_.decodeOpacityString(opacity_def);

  setOpacity(opacity);
}
开发者ID:chagge,项目名称:CSVG,代码行数:8,代码来源:CSVGStroke.cpp


示例2: setOpacity

	void PopUpMenu::logic( double timeElapsed )
	{
		agui::PopUpMenu::logic(timeElapsed);
		if(getOpacity() < 1.0f)
		{
			setOpacity(getOpacity() + m_opacityRate);
		}
	}
开发者ID:jmasterx,项目名称:StemwaterSpades,代码行数:8,代码来源:PopUpMenu.cpp


示例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);
}
开发者ID:hyd998877,项目名称:Cocos2dxSRPGQuest,代码行数:17,代码来源:ItemWindowLayer.cpp


示例4: setOpacity

void
MCSkillBarItem::coldTimeDidFinish(CCObject *anObject)
{
    CCProgressTimer *progressTimer = dynamic_cast<CCProgressTimer *>(anObject);
    
    progressTimer->removeFromParentAndCleanup(true);
    setOpacity(kMCSkillBarItemActiveSkillOpacity);
}
开发者ID:edison9888,项目名称:__graduation_project,代码行数:8,代码来源:MCSkillBar.cpp


示例5: RotationOriginIndicator

 RotationOriginIndicator(QGraphicsItem *parent = 0)
     : QGraphicsItem(parent)
 {
     setFlags(QGraphicsItem::ItemIgnoresTransformations |
              QGraphicsItem::ItemIgnoresParentOpacity);
     setZValue(10000 + 1);
     setOpacity(0.5);
 }
开发者ID:MHendricks,项目名称:tiled,代码行数:8,代码来源:objectselectiontool.cpp


示例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;
}
开发者ID:JungSeBin,项目名称:Go3War,代码行数:58,代码来源:PencilLayer.cpp


示例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"));
}
开发者ID:Ivaho,项目名称:Client,代码行数:9,代码来源:OpacityCommand.cpp


示例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;
	}


}
开发者ID:Johan08,项目名称:cocos2d-x-3.2-ui-,代码行数:57,代码来源:HelloWorldScene.cpp


示例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;
}
开发者ID:Hyacinth,项目名称:cocos2dx-ext,代码行数:9,代码来源:CCPrimitiveNodes.cpp


示例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 );
}
开发者ID:Zakui,项目名称:QGIS,代码行数:9,代码来源:qgsrasterrenderer.cpp


示例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;
}
开发者ID:Hyacinth,项目名称:cocos2dx-ext,代码行数:9,代码来源:CCPrimitiveNodes.cpp


示例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
}
开发者ID:kdbanman,项目名称:browseRDF,代码行数:9,代码来源:GraphicsWidgetBase.cpp


示例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);
}
开发者ID:neight968,项目名称:TC_FlicGame,代码行数:9,代码来源:MainScene.cpp


示例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 );
}
开发者ID:ClAndHHL,项目名称:cocos3d-x,代码行数:10,代码来源:CC3ShadowVolumes.cpp


示例15: setVisible

void LongPressSpinner::setGoodPress(bool flag)
{
	setVisible(true);
	setOpacity(1.0);
	prepareGeometryChange();
	m_goodPressFlag = flag;
	m_goodPressTimer.start();
	update();
}
开发者ID:aicconsulting,项目名称:wifisigmap,代码行数:9,代码来源:LongPressSpinner.cpp


示例16: setPos

void Explosion::demmarer(QPointF position, double amplitude)
{
    animationExplosion1->setEndValue(amplitude);
    animationExplosion2->setStartValue(amplitude);

    setPos(position - boundingRect().center());
    setOpacity(1);
    animationExplosionRoot->start();
}
开发者ID:maidmaid,项目名称:maiday,代码行数:9,代码来源:explosion.cpp


示例17: setFixedSize

void ActiveLabel::show()
{
    QLabel::show();
    setFixedSize(24, 5);
    setOpacity(1);
    m_iconPath = m_openIndicatorIcon;
    update();
    emit sizeChange();
}
开发者ID:tsuibin,项目名称:dde-dock,代码行数:9,代码来源:appbackground.cpp


示例18: setOpacity

QVariant CornerHandle::itemChange(GraphicsItemChange change,
                                  const QVariant &value)
{
    if (change == ItemVisibleHasChanged) {
        if (value.toBool())
            setOpacity(isUnderMouse() ? 1 : 0.5);
    }
    return QGraphicsItem::itemChange(change, value);
}
开发者ID:bradley45,项目名称:tiled,代码行数:9,代码来源:objectselectiontool.cpp


示例19: addStep

void TopData::addStep(cocos2d::Node *node, int step, int time)
{
    this->restStep += step;
    
    auto topNode = node->getChildByTag(MAIN_SCENE_TOP_NODE);
    
    auto textLimit = topNode->getChildByName<ui::Text *>("TextLimit");
    textLimit->setString(Value(this->restStep).asString());
    
    auto text = textLimit->clone();
    text->setGlobalZOrder(100);
    text->setOpacity(200);
    topNode->addChild(text);
    
    auto scale = ScaleTo::create(0.5, 2.5);
    auto fade = FadeOut::create(0.5);
    auto callFunc = CallFunc::create([=]{
        text->removeFromParent();
    });
    
    text->runAction(scale);
    text->runAction(Sequence::create(fade, callFunc, NULL));
    
    if(UserData::getInstance()->challenges == 1)
    {
        this->restime += time;
        
        auto textTime = topNode->getChildByName<ui::Text *>("TextTime");
        textTime->setString(Value(this->restime).asString());
        
        auto text1 = textTime->clone();
        text1->setGlobalZOrder(100);
        text1->setOpacity(200);
        topNode->addChild(text1);
        
        auto scale1 = ScaleTo::create(0.5, 2.5);
        auto fade1 = FadeOut::create(0.5);
        auto callFunc1 = CallFunc::create([=]{
            text1->removeFromParent();
        });
        text1->runAction(scale1);
        text1->runAction(Sequence::create(fade1, callFunc1, NULL));
    }
}
开发者ID:yushengcao,项目名称:Monsters,代码行数:44,代码来源:TopData.cpp


示例20: QGraphicsRectItem

ViewProfileDivider::ViewProfileDivider (QGraphicsScene &scene,
                                        QGraphicsView &view,
                                        int sceneWidth,
                                        int sceneHeight,
                                        int yCenter,
                                        bool isLowerBoundary) :
  QGraphicsRectItem (X_INITIAL,
                     0,
                     PADDLE_WIDTH,
                     PADDLE_HEIGHT),
  m_view (view),
  m_yCenter (yCenter),
  m_divider (0),
  m_shadedArea (0),
  m_sceneWidth (sceneWidth),
  m_sceneHeight (sceneHeight),
  m_isLowerBoundary (isLowerBoundary)
{
  // Initial positions will not appear since they are overridden by setX

  // Paddle
  setVisible (true);
  setPen (QPen (DIVIDER_COLOR));
  setBrush (QBrush (QColor (140, 255, 140)));
  setOpacity (1.0);
  scene.addItem (this);
  setFlags (QGraphicsItem::ItemIsMovable |
            QGraphicsItem::ItemSendsGeometryChanges);
  setCursor (Qt::OpenHandCursor);
  setZValue (2.0);

  // Arrow on paddle
  m_arrow = new QGraphicsPolygonItem (this);

  // Shaded area
  m_shadedArea = new QGraphicsRectItem (X_INITIAL,
                                        0,
                                        0,
                                        sceneHeight - 1);
  m_shadedArea->setOpacity (SHADED_AREA_OPACITY);
  m_shadedArea->setBrush (QBrush (SHADED_AREA_COLOR));
  m_shadedArea->setPen (Qt::NoPen);
  m_shadedArea->setZValue (0.0);
  scene.addItem (m_shadedArea);

  // Vertical divider. This is not made a child of the paddle since that will force the divider
  // to always be drawn above the paddle, rather than underneath the paddle as we want. Even setting
  // the z values will not succeed in drawing the divider under the paddle if they are child-parent.
  m_divider = new QGraphicsLineItem (X_INITIAL,
                                     -SLOP,
                                     X_INITIAL,
                                     2 * SLOP + sceneHeight);
  m_divider->setPen (QPen (QBrush (DIVIDER_COLOR), DIVIDER_WIDTH));
  m_divider->setZValue (1.0);
  scene.addItem (m_divider);
}
开发者ID:TobiasWinchen,项目名称:engauge-digitizer,代码行数:56,代码来源:ViewProfileDivider.cpp



注:本文中的setOpacity函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setOpaque函数代码示例发布时间:2022-05-30
下一篇:
C++ setOnlineOfflineState函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap