Here’s my particular code context. Its an ITextControl … but only want to ghost it temporarily when something else is happening later, but it seems that it always runs the animation function on attach. Am I missing something?
pGraphics->AttachControl(new ITextControl
(consoleBounds,
consoleText.c_str(),
consoleTextDef,
COLOR_WHITE,
true
)
, kCtrlNetStatus)
->SetAnimation(
[this] (IControl* pCaller) {
pCaller->SetDisabled(false);
auto progress = pCaller->GetAnimationProgress();
if(progress>1.0f) {
pCaller->SetDisabled(true);
pCaller->SetMouseOverWhenDisabled(true);
pCaller->OnEndAnimation(); return;
}
} , 500.0f
);