Re: Creating a Storyboard using C++
Posted: 18 Jun 2015, 01:02
Has there been any update?
Welcome to our official discussion site. You’ll find topics on features, bugs, development, and general support here
https://www.noesisengine.com/forums/
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
Noesis::Ptr<Noesis::DoubleAnimation> anim = *new Noesis::DoubleAnimation();
anim->SetFrom(1.0f);
anim->SetTo(0.0f);
anim->SetDuration(Noesis::TimeSpan(0, 0, 0, 0, 500));
Noesis::SetTarget(anim.GetPtr(), m_cCanvas);
Noesis::Ptr<Noesis::PropertyPath> path = *new Noesis::PropertyPath("Opacity");
Noesis::SetTargetProperty(anim.GetPtr(), path.GetPtr());
Noesis::Ptr<Noesis::Storyboard> pStoryboard = *new Noesis::Storyboard();
pStoryboard->GetChildren()->Add(anim.GetPtr());
using namespace Noesis;
Drawing::Color transparent(0.0f, 0.0f, 0.0f, 0.0f);
Drawing::Color black = Drawing::Color::Black;
NsFloat64 halfDuration = static_cast<NsFloat64>(duration * 0.5f);
// Fade in
Core::Ptr<Gui::PropertyPath> bgProperty = *new Gui::PropertyPath(Gui::Panel::BackgroundProperty);
Core::Ptr<Gui::ColorAnimation> pAnimIn = *new Gui::ColorAnimation();
pAnimIn->SetFrom(Core::Nullable<Drawing::Color>(transparent));
pAnimIn->SetTo(Core::Nullable<Drawing::Color>(black));
pAnimIn->SetDuration(Gui::TimeSpan(static_cast<NsFloat64>(halfDuration)));
Gui::Storyboard::SetTarget(pAnimIn.GetPtr(), this);
Gui::Storyboard::SetTargetProperty(pAnimIn.GetPtr(), bgProperty.GetPtr());
Core::Ptr<Gui::Storyboard> pStoryboard = *new Gui::Storyboard();
pStoryboard->GetChildren()->Add(pAnimIn.GetPtr());
pStoryboard->Begin();Core::Ptr<Gui::PropertyPath> bgProperty = *new Gui::PropertyPath("Background.Color"); storyboard->Begin(this);