当前位置: 首页>>代码示例>>C++>>正文


C++ setAlpha函数代码示例

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


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

示例1: setAlpha

void GUIAlphaElement::modifyCurrentAlpha(float clockTick)
{
  if(!mouseOver && !pressed)
    setAlpha(color.w - clockTick * alphaFadeScale);
  else
    setAlpha(color.w + clockTick * alphaFadeScale);
}
开发者ID:fresheneesz,项目名称:experiments,代码行数:7,代码来源:GUIAlphaElement.cpp

示例2: split

void Color::applySettings(ResourceDescriptor settings) {

    std::vector<std::string> values = split(settings.getValue(), ',');
    if (values.size() == 3 || values.size() == 4) {
        setRed(std::stoi(values[0]));
        setGreen(std::stoi(values[1]));
        setBlue(std::stoi(values[2]));
    }
    if (values.size() == 4) {
        setAlpha(std::stoi(values[2]));
    }

    ResourceDescriptor sub = settings.getSubResource("Red");
    if (isNotEmpty(sub.getValue())) {
        setRed(std::stoi(sub.getValue()));
    }

    sub = settings.getSubResource("Green");
    if (isNotEmpty(sub.getValue())) {
        setGreen(std::stoi(sub.getValue()));
    }

    sub = settings.getSubResource("Blue");
    if (isNotEmpty(sub.getValue())) {
        setBlue(std::stoi(sub.getValue()));
    }

    sub = settings.getSubResource("Alpha");
    if (isNotEmpty(sub.getValue())) {
        setAlpha(std::stoi(sub.getValue()));
    }

}
开发者ID:jamethy,项目名称:battle_room,代码行数:33,代码来源:color.cpp

示例3: setInterceptsMouseClicks

void GuiPiano::setActive (bool value)
{
    setInterceptsMouseClicks(false, value);
    
    if (value == true)
    {
        setAlpha(1.0f);
        //don't think I need to set label text here as it will be set somewhere else.
    }
    else
    {
        setAlpha(0.3f);
        
        midiNoteLabel->setText(String::empty, dontSendNotification);
        
        for (int i = 0; i < 120; i++)
            setKeyDisplay(i, false);
    }
    
    /*
    else if (value == true)
    {
        updateDisplay();
    }
     */
    
}
开发者ID:ankit--sethi,项目名称:AlphaLive,代码行数:27,代码来源:GuiPiano.cpp

示例4: setAlpha

void MoonWalker::render(VoodooGraphics graphics, int elapsed)
{
    graphics.painter()->save();

    // если нужно создать наклон для машинки

    if(position()->x() >= 0 && position()->x() <= 30)
    {
        setAlpha(1);
    } else if (position()->x() >= 30 && position()->x() <= 50)
    {
        setAlpha(2);
    } else if (position()->x() >= 100 && position()->x() <= 300)
    {
        setAlpha(-1);
    } else if (position()->x() >= 300 && position()->x() <= 510)
    {
        setAlpha(1);
    } else if (position()->x() >= 510 && position()->x() <= 800)
    {
        setAlpha(-4);
    }

    // тело машины
    drawLines(graphics, lines1);
    // кабинка
    drawLines(graphics, lines2);
    // антенна
    drawLines(graphics, lines3);

    QPoint point;
    qint32 radius = 1 * scale();
    for(int i = 0; i < 4; i++)
    {
        point = graphics.rotate(10 * scale() - i * radius * 2, 7 * scale(), alpha());
        graphics.drawCircle(point.x() + position()->x(), point.y() + position()->y(), radius);
        graphics.drawCircle(point.x() + position()->x(), point.y() + position()->y(), elapsed / 160);
    }

    // антенна
    point = graphics.rotate(12 * scale(), 0, alpha());
    graphics.drawCircle(position()->x() + point.x(), position()->y() + point.y(), 1 * scale());
    graphics.drawCircle(position()->x() + point.x(), position()->y() + point.y(), 5);
    graphics.drawCircle(position()->x() + point.x(), position()->y() + point.y(), elapsed / 20);

    if (position()->x() >= width() + 10)
    {
        setPosition(0, position()->y());
        setIterator(0);
    }

    setPosition(iterator() + 1, position()->y());
    setIterator(iterator() + 1);
    graphics.painter()->restore();
}
开发者ID:oivoodoo,项目名称:MoonWalker,代码行数:55,代码来源:moonwalker.cpp

示例5: setAlpha

LevenshteinDistance::LevenshteinDistance(double alpha)
{
  if (alpha == -1)
  {
    setAlpha(ConfigOptions().getLevenshteinDistanceAlpha());
  }
  else
  {
    setAlpha(alpha);
  }
}
开发者ID:Nanonid,项目名称:hootenanny,代码行数:11,代码来源:LevenshteinDistance.cpp

示例6: getParent

/*************************************************************************
	Tells the popup menu to open.
*************************************************************************/
void PopupMenu::openPopupMenu(bool notify)
{
    // already open and not fading, or fading in?
    if (d_isOpen && (!d_fading || !d_fadingOut))
    {
        // then don't do anything
        return;
    }

    // should we let the parent menu item initiate the open?
    Window* parent = getParent();
    if (notify && parent && parent->testClassName("MenuItem"))
    {
        static_cast<MenuItem*>(parent)->openPopupMenu();
        return; // the rest will be handled when MenuItem calls us itself
    }

    // we'll handle it ourselves then.
	// are we fading, and fading out?
	if (d_fading && d_fadingOut)
	{
		if (d_fadeInTime>0.0f&&d_fadeOutTime>0.0f)
		{
			// jump to the point of the fade in that has the same alpha as right now - this keeps it smooth
			d_fadeElapsed = ((d_fadeOutTime-d_fadeElapsed)/d_fadeOutTime)*d_fadeInTime;
		}
		else
		{
			// start the fade in from the beginning
			d_fadeElapsed = 0;
		}
		// change to fade in
		d_fadingOut=false;
	}
	// otherwise just start normal fade in!
	else if (d_fadeInTime>0.0f)
	{
		d_fading = true;
		d_fadingOut=false;
		setAlpha(0.0f);
		d_fadeElapsed = 0;
	}
	// should not fade!
	else
	{
		d_fading = false;
		setAlpha(d_origAlpha);
	}
	
	show();
	moveToFront();
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:55,代码来源:CEGUIPopupMenu.cpp

示例7: setAlpha

	void Window::setAutoAlpha(bool _auto)
	{
		mIsAutoAlpha = _auto;
		if (!_auto)
			setAlpha(ALPHA_MAX);
		else
		{
			if (mKeyRootFocus)
				setAlpha(WINDOW_ALPHA_ACTIVE);
			else if (mMouseRootFocus)
				setAlpha(WINDOW_ALPHA_FOCUS);
			else
				setAlpha(WINDOW_ALPHA_DEACTIVE);
		}
	}
开发者ID:norak,项目名称:MMO-Framework,代码行数:15,代码来源:MyGUI_Window.cpp

示例8: UncertaintyDescription

FrechetDistribution::FrechetDistribution(double alpha, double beta) 
  : UncertaintyDescription(boost::shared_ptr<detail::UncertaintyDescription_Impl>(
        new detail::UncertaintyDescription_Impl(FrechetDistribution::type())))
{
  setAlpha(alpha);
  setBeta(beta);
}
开发者ID:Rahjou,项目名称:OpenStudio,代码行数:7,代码来源:FrechetDistribution.cpp

示例9: init

/*!

  Constructor.

  Call init() to initialise the Hinkley's test and set \f$\alpha\f$
  and \f$\delta\f$ to default values.

  By default \f$ \delta = 0.2 \f$ and \f$ \alpha = 0.2\f$. Use
  setDelta() and setAlpha() to modify these values.

*/
vpHinkley::vpHinkley()
{
  init();

  setAlpha(0.2);
  setDelta(0.2);
}
开发者ID:nttputus,项目名称:visp,代码行数:18,代码来源:vpHinkley.cpp

示例10: removeImage

	void Txtr::load(const fschar *colorsFileName, const fschar *alphaFileName)
	{
		removeImage();
		if (colorsFileName) loadColors(colorsFileName);
		if (alphaFileName && hasImage()) loadAlpha(alphaFileName, 255);
		else setAlpha(255);
	}
开发者ID:southor,项目名称:torso-gui,代码行数:7,代码来源:Txtr.cpp

示例11: setAlpha

bool Rgb::setSlotAlpha(Number* const msg)
{
    LCreal value = msg->getReal();
    bool ok = setAlpha( value );
    if (!ok) std::cerr << "Rgb::setAlpha: invalid entry(" << value << "), valid range: 0 to 1" << std::endl;
    return ok;
}
开发者ID:derekworth,项目名称:afit-swarm-simulation,代码行数:7,代码来源:Rgb.cpp

示例12: setScale

void NumberAnimation::setParametr(const std::string & _param, double _value)
{
	m_currentParam = _param;
	if (_param == "scale")
	{
		m_params[_param] = _value;
		setScale();
	}
	else if (_param == "angle")
	{
		m_params[_param] = _value;
		setAngle();
	}
	else if (_param == "alpha")
	{
		m_params[_param] = _value;
		setAlpha();
	}
	else if (_param == "width")
	{
		m_params[_param] = _value;
		setWidth();
	}
	else if (_param == "height")
	{
		m_params[_param] = _value;
		setHeight();
	}
	else
	{
		m_currentParam = "";
	}
}
开发者ID:KyryloBR,项目名称:SDLEngine,代码行数:33,代码来源:NumberAnimation.cpp

示例13: setRed

void CVX_Material::setColor(int red, int green, int blue, int alpha)
{
	setRed(red);
	setGreen(green);
	setBlue(blue);
	setAlpha(alpha);
}
开发者ID:CreativeMachinesLab,项目名称:voxcadNASA,代码行数:7,代码来源:VX_Material.cpp

示例14: setRed

void Color::set( float r, float g, float b, float a )
{
	setRed( r );
	setGreen( g );
	setBlue( b );
	setAlpha( a );
}
开发者ID:wooffull,项目名称:CollectEmUp,代码行数:7,代码来源:Color.cpp

示例15: ss

void Drawable::nonConstDraw (Graphics& g, float opacity, const AffineTransform& transform)
{
    Graphics::ScopedSaveState ss (g);

    const float oldOpacity = getAlpha();
    setAlpha (opacity);
    g.addTransform (AffineTransform::translation ((float) -originRelativeToComponent.getX(),
                                                  (float) -originRelativeToComponent.getY())
                        .followedBy (getTransform())
                        .followedBy (transform));

    if (! g.isClipEmpty())
        paintEntireComponent (g, false);

    setAlpha (oldOpacity);
}
开发者ID:Labmind,项目名称:GUI,代码行数:16,代码来源:juce_Drawable.cpp


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