// Constructor SlideOutWidget::SlideOutWidget() { mActivating = false; mWidth = 350; // Menus should set this to a real value so they appear more quickly setStartingOffset(0); mDisplayEasing = Easing::QuarticEaseIn; mHideEasing = Easing::QuarticEaseOut; }
// User requested widget to close void SlideOutWidget::onDeactivated() { S32 currentWidth = getCurrentDisplayWidth(); S32 expectedWidth = getTotalDisplayWidth(); setStartingOffset(0); setExpectedWidth(expectedWidth); mAnimationTimer.reset(currentWidth / WidgetSpeed, expectedWidth / WidgetSpeed); mActivating = false; }
// User requested widget to open void SlideOutWidget::onActivated() { S32 currDisplayWidth = 0; mActivationDirection = true; // Normal // If we're still playing the animation from a previous action, we need to grab it's width to // use as the starting point for animating this activation if(isActive()) currDisplayWidth = getCurrentDisplayWidth(); mActivating = true; setStartingOffset(currDisplayWidth); adjustAnimationTimer(); }
// Constructor SlideOutWidget::SlideOutWidget() { mActivating = false; mWidth = 350; // Menus should set this to a real value so they appear more quickly setStartingOffset(0); }