本文整理汇总了C++中setAlpha函数的典型用法代码示例。如果您正苦于以下问题:C++ setAlpha函数的具体用法?C++ setAlpha怎么用?C++ setAlpha使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAlpha函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setEnabledSilent
void Window::setVisibleSmooth(bool _visible)
{
mAnimateSmooth = true;
ControllerManager::getInstance().removeItem(this);
if (_visible)
{
setEnabledSilent(true);
if (!getVisible())
{
setAlpha(ALPHA_MIN);
Base::setVisible(true);
}
ControllerFadeAlpha* controller = createControllerFadeAlpha(getAlphaVisible(), WINDOW_SPEED_COEF, true);
controller->eventPostAction += newDelegate(this, &Window::animateStop);
ControllerManager::getInstance().addItem(this, controller);
}
else
{
setEnabledSilent(false);
ControllerFadeAlpha* controller = createControllerFadeAlpha(ALPHA_MIN, WINDOW_SPEED_COEF, false);
controller->eventPostAction += newDelegate(action::actionWidgetHide);
ControllerManager::getInstance().addItem(this, controller);
}
}
开发者ID:norak,项目名称:MMO-Framework,代码行数:25,代码来源:MyGUI_Window.cpp
示例17: getFixedArgs
/* Process command line parameters:
argv[1]: Name of data file or '-' for stdin
argv[2]: Number of changepoints
argv[3]: Number of iterations
argv[4]: seed for random number generator
argv[5]: (optional) Prefix for output files
*/
void getFixedArgs(int argc, char **argv) {
char* endptr;
const char* usage="icmcstatFixed FILE NK ITERATIONS SEED [OUTPUTPREFIX]";
double alpha=1, beta=1;
if(argc<5) fprintf(ERR, "%s\n", usage), exit(1);
dataFn=argv[1];
printf("Reading data from ");
if(!strcmp(dataFn, "-")) printf("stdin\n");
else printf("%s\n", dataFn);
printf("%s nK\n", argv[2]);
nK = strtol(argv[2], &endptr, 10);
nProb=nK+1;
printf("%s iterations\n", argv[3]);
nIter = strtol(argv[3], &endptr, 10);
seed = strtol(argv[4], &endptr, 10);
printf("Seed for random number generator: %i\n", seed);
/* Optional parameter*/
if(argc==6) {
prefix=argv[5];
printf("Prefix prepended to output files: %s\n", prefix);
}
fprintf(ERR, "Setting alpha=%g, beta=%g\n", alpha, beta);
setAlpha(alpha); setBeta(beta);
}
开发者ID:merlinthemagician,项目名称:icmcstat,代码行数:38,代码来源:icmcstat.c
示例18: setAlpha
//------------------------------------------------------------
//------------------------------------------------------------
bool Pareto::setSlotAlpha(const Number* const x)
{
bool ok = false;
if(x != 0)
ok = setAlpha(x->getDouble());
return ok;
}
开发者ID:azcbuell,项目名称:OpenEaagles,代码行数:9,代码来源:Pareto.cpp
示例19: setAlpha
// Called every frame
void SpriteActorView::update(float dt)
{
ActorView::update(dt);
// If sprite needs to fade, fade according to passed time from last frame
if (_fadeDuration > 0)
{
float fadeDelta = _targetAlpha - _alpha;
float timeDelta = _fadeDuration / dt;
setAlpha(_alpha + (fadeDelta / timeDelta));
_fadeDuration -= dt;
}
// Check if we need to move
if (!_isMoving && !_movementQueue.empty()) {
// std::cout << "SpriteActorView::update - Popping movement " << _movementQueue.front().animationName << std::endl;
Movement movement = _movementQueue.front();
_currentMovement = &movement;
// Start animation
playAnimation(movement.animationName);
// Move
moveTo(movement.target, movement.duration);
_movementQueue.pop_front();
} else if (!_isMoving && _movementQueue.empty() && _currentMovement != NULL) {
// Just finished queue,publish event
_currentMovement = NULL;
EventManager::getInstance()->publish("MOVEMENT_QUEUE_ENDED", _agent);
}
}
开发者ID:Avnerus,项目名称:ichigo,代码行数:35,代码来源:SpriteActorView.cpp
示例20: setAlpha
void OffScreenExplode::setActive()
{
active = true;
setAlpha(0);
changeAnimation("normal", FORWARD);
Console::WriteLine("setting OffScreenExplode Active");
}
开发者ID:3Xpedite,项目名称:iSSB,代码行数:7,代码来源:OffScreenExplode.cpp
注:本文中的setAlpha函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论