本文整理汇总了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);
}
示例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()));
}
}
示例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();
}
*/
}
示例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();
}
示例5: setAlpha
LevenshteinDistance::LevenshteinDistance(double alpha)
{
if (alpha == -1)
{
setAlpha(ConfigOptions().getLevenshteinDistanceAlpha());
}
else
{
setAlpha(alpha);
}
}
示例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();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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 = "";
}
}
示例13: setRed
void CVX_Material::setColor(int red, int green, int blue, int alpha)
{
setRed(red);
setGreen(green);
setBlue(blue);
setAlpha(alpha);
}
示例14: setRed
void Color::set( float r, float g, float b, float a )
{
setRed( r );
setGreen( g );
setBlue( b );
setAlpha( a );
}
示例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);
}