development version (master branch)
Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

Animation functions

 

void Animate(Ctrl& ctrl, const Upp::Rect& target, int type = -1)

void Animate(Ctrl& ctrl, int x, int y, int cx, int cy, int type = -1)

Animates a ctrl to transition smoothly to a target rectangle using a specified animation effect. The animation effect type can be GUIEFFECT_SLIDE, which moves the control gradually to the target position, or GUIEFFECT_FADE, which gradually adjusts the control’s transparency from fully transparent to fully opaque. If the type is set to a negative value, the function will use the global UI setting. Any other value will cause the the ctrl to jump directly to the target rectangle without any animation.

 


 

void Animate(Event<double> update, int duration = 100)

Performs GUI animation, repeatedly calling update with increasing numbers from the interval 0..1 for duration milliseconds.

 


 

void Animate(Vector<Ptr<Ctrl>>& ctrls, const Vector<Rect>& targets, int duration = 100)

Animates the transition of multiple ctrls from their current positions to the target positions specified by the targets parameter, over a given duration. The default duration is 100 miliseconds. The number of ctrls must match the number of the target rectangles otherwise the function will silently return without modifying anything.

 


 

template <class T>

void Animate(Vector<T>& data, const Vector<T>& targets, Event<> update, int duration = 100)

Animates the transition of multiple data values from their current positions to the target positions specified by the targets parameter, over a given duration. The default duration is 100 miliseconds. The number of data values must match the number of the targets values otherwise the function will silently return without modifying anything. After each animation step Animate calls update.

 

 

Do you want to contribute?