Permalink
Browse files

UI: Add an event for tween finish.

  • Loading branch information...
unknownbrackets committed Dec 10, 2017
1 parent 46ea88e commit 6194ef60beb615ebb5a05b7738f260a742095f12
Showing with 9 additions and 0 deletions.
  1. +7 −0 ext/native/ui/ui_tween.cpp
  2. +2 −0 ext/native/ui/ui_tween.h
@@ -13,6 +13,13 @@ void Tween::Apply(View *view) {
float pos = Position();
DoApply(view, pos);
if (finishApplied_) {
UI::EventParams e{};
e.v = view;
e.f = DurationOffset() - duration_;
Finish.Trigger(e);
}
}
template <typename Value>
@@ -36,6 +36,8 @@ class Tween {
virtual void PersistData(PersistStatus status, std::string anonId, PersistMap &storage) = 0;
Event Finish;
protected:
float DurationOffset() {
return time_now() - start_ - delay_;

0 comments on commit 6194ef6

Please sign in to comment.