void HandleDeleteModeOpen(AbstractTween obj) { deleteOkBox.isTouchable = true; deleteCancelBox.isTouchable = true; deleteCancelBox.SignalRelease += (box) => { deleteCancelBox.isTouchable = false; deleteOkBox.isTouchable = false; deleteCancelBox.DoTapEffect(); FSoundManager.PlaySound("UI/Cancel", 0.5f); FSoundManager.PlaySound("UI/MathClose"); isOpeningDelete = false; deleteModeTweenable.To(0.0f, 0.5f, new TweenConfig().onComplete(HandleDeleteModeClose)); CreateKeyboard(0.2f); CreateSwatches(0.5f); }; deleteOkBox.SignalRelease += (box) => { deleteCancelBox.isTouchable = false; deleteOkBox.isTouchable = false; okBox.Destroy(); //it's offscreen anyway! deleteOkBox.DoTapEffect(); FSoundManager.PlaySound("UI/Button1"); Go.to(this, 0.4f, new TweenConfig() .floatProp("scale", 0.0f) .setEaseType(EaseType.ExpoIn) .onComplete(HandleDeleteComplete)); }; }
private static void HandleExplodeSpriteComplete(AbstractTween tween) { //爆炸粒子播放完毕后移除Container FSprite explodeSprite = (tween as Tween).target as FSprite; explodeSprite.RemoveFromContainer(); }
/// <summary> /// adds a Tween to the front of the flow /// </summary> public TweenChain prepend( AbstractTween tween ) { var item = new TweenFlowItem( 0, tween ); prepend( item ); return this; }
private void HandleBombExplosionComplete(AbstractTween tween) { Exp1 explodedBomb = (tween as Tween).target as Exp1; //RemoveAllChildren (); //Exp1.instance.SwitchToTitlePage(); }
/// <summary> /// appends a Tween at the end of the current flow /// </summary> public TweenChain append( AbstractTween tween ) { var item = new TweenFlowItem( duration, tween ); append( item ); return this; }
/// <summary> /// inserts a Tween and sets it to start at the given startTime /// </summary> public TweenFlow insert( float startTime, AbstractTween tween ) { var item = new TweenFlowItem( startTime, tween ); insert( item ); return this; }
public void OnFinalNoteLabelFinishedHiding(AbstractTween tween) { finalNoteAnimating = false; finalNoteShowing = false; currentFinalNoteLabel.isVisible = false; currentFinalNoteLabel = null; }
void HandleShowComplete(AbstractTween obj) { if (SignalShowComplete != null) { SignalShowComplete(); } }
public void DoneShowingLabel(AbstractTween tween) { label.isVisible = false; labelIsAnimating = labelIsInPlace = false; stringQueue.Remove(stringQueue[0]); }
public void OnHeartFinished(AbstractTween tween) { FSprite heart = (tween as Tween).target as FSprite; heart.alpha = 1.0f; heart.RemoveFromContainer(); }
/// <summary> /// appends a Tween at the end of the current flow /// </summary> public TweenChain append(AbstractTween tween) { var item = new TweenFlowItem(duration, tween); append(item); return(this); }
/// <summary> /// adds a Tween to the front of the flow /// </summary> public TweenChain prepend(AbstractTween tween) { var item = new TweenFlowItem(0, tween); prepend(item); return(this); }
void HandleHideComplete(AbstractTween obj) { this.RemoveFromContainer(); if (SignalHideComplete != null) { SignalHideComplete(); } }
/// <summary> /// inserts a Tween and sets it to start at the given startTime /// </summary> public TweenFlow insert(float startTime, AbstractTween tween) { var item = new TweenFlowItem(startTime, tween); insert(item); return(this); }
public void DoneDestroying(AbstractTween tween) { for (int i = _childNodes.Count - 1; i >= 0; i--) { FSprite sprite = GetChildAt(0) as FSprite; RemoveChild(sprite); } this.RemoveFromContainer(); }
public void HandleDrinkerFinishedSittingDown(AbstractTween tween) { if (!isSpecial) { // only use the timer when they're waiting at the bar, not their own chair owner.ProgressBarComponent().progressBar.isVisible = true; owner.ProgressBarComponent().progressBar.percent = 1; owner.TimerComponent().Restart(); } currentDrinker.Sit(); }
private static void BrickDead(AbstractTween tween) { Tween tweenReal = tween as Tween; Brick brick = tweenReal.target as Brick; // Make sure I'm still dieing if (brick.BeingKilled == true) { brick.RemoveFromContainer(); bricks.Remove(brick); } }
public void ButtonDoneFading(AbstractTween tween) { FButton button = (tween as Tween).target as FButton; button.RemoveFromContainer(); if (button == whitButton) { whitButton = null; } else if (button == danaButton) { danaButton = null; } }
/// <summary> /// adds an AbstractTween (Tween, TweenChain or TweenFlow) to the current list of running Tweens /// </summary> public static void addTween(AbstractTween tween) { // early out for invalid items if (!tween.isValid()) { return; } // dont add the same tween twice if (_tweens.Contains(tween)) { return; } // check for dupes and handle them before adding the tween. we only need to check for Tweens if (duplicatePropertyRule != DuplicatePropertyRuleType.None && tween is Tween) { // if handleDuplicatePropertiesInTween returns true it indicates we should not add this tween if (handleDuplicatePropertiesInTween(tween as Tween)) { return; } // if we became invalid after handling dupes dont add the tween if (!tween.isValid()) { return; } } _tweens.Add(tween); // enable ourself if we are not enabled if (!instance.enabled) // purposely using the static instace property just once for initialization { _instance.enabled = true; } // if the Tween isn't paused and it is a "from" tween jump directly to the start position if (tween is Tween && ((Tween)tween).isFrom && tween.state != TweenState.Paused) { tween.update(0); } // should we start up the time scale independent update? if (!_instance._timeScaleIndependentUpdateIsRunning && tween.updateType == UpdateType.TimeScaleIndependentUpdate) { _instance.StartCoroutine(_instance.timeScaleIndependentUpdate()); } }
public void OnHeartDisappearedWithoutBeingTouched(AbstractTween tween) { FSprite heart = (tween as Tween).target as FSprite; if (heart == null) { return; } KillHeart(heart); numHeartsMissed++; if (!gameIsOver) { FSoundManager.PlaySound("shrink", 0.3f); } }
/// <summary> /// removes the Tween returning true if it was removed or false if it was not found /// </summary> public static bool removeTween(AbstractTween tween) { if (_tweens.Contains(tween)) { _tweens.Remove(tween); if (_tweens.Count == 0) { // disable ourself if we have no more tweens instance.enabled = false; } return(true); } return(false); }
public void HandleTitleDoneInflating(AbstractTween abstractTween) { /*TweenConfig alphaTweenConfig = new TweenConfig(); * * TweenConfig scaleUpTweenConfig = new TweenConfig(); * scaleUpTweenConfig.addTweenProperty(new FloatTweenProperty("scale", 1.1f, false)); * scaleUpTweenConfig.setEaseType(EaseType.BackOut); * * TweenConfig scaleDownTweenConfig = new TweenConfig(); * scaleUpTweenConfig.addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)); * scaleUpTweenConfig.setEaseType(EaseType.BackOut); * * Tween scaleUpTween = new Tween(this, 0.2f, scaleUpTweenConfig); * Tween scaleDownTween = new Tween(this, 0.2f, scaleDownTweenConfig); * * TweenFlow tweenFlow = new TweenFlow(); * tweenFlow.insert(0.0f, scaleUpTween); * tweenFlow.insert(0.2f, scaleDownTween); * tweenFlow.setIterations(10000000, LoopType.RestartFromBeginning); * tweenFlow.play();*/ }
public void HandleTitleDoneInflating(AbstractTween abstractTween) { /*TweenConfig alphaTweenConfig = new TweenConfig(); TweenConfig scaleUpTweenConfig = new TweenConfig(); scaleUpTweenConfig.addTweenProperty(new FloatTweenProperty("scale", 1.1f, false)); scaleUpTweenConfig.setEaseType(EaseType.BackOut); TweenConfig scaleDownTweenConfig = new TweenConfig(); scaleUpTweenConfig.addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)); scaleUpTweenConfig.setEaseType(EaseType.BackOut); Tween scaleUpTween = new Tween(this, 0.2f, scaleUpTweenConfig); Tween scaleDownTween = new Tween(this, 0.2f, scaleDownTweenConfig); TweenFlow tweenFlow = new TweenFlow(); tweenFlow.insert(0.0f, scaleUpTween); tweenFlow.insert(0.2f, scaleDownTween); tweenFlow.setIterations(10000000, LoopType.RestartFromBeginning); tweenFlow.play();*/ }
public void OnWinLabelDoneAppearing(AbstractTween tween) { gameFullyOver = true; FLabel label = (tween as Tween).target as FLabel; Tween up = new Tween(label, 0.3f, new TweenConfig() .floatProp("scale", 1.1f) .setEaseType(EaseType.SineInOut)); Tween down = new Tween(label, 0.3f, new TweenConfig() .floatProp("scale", 1.0f) .setEaseType(EaseType.SineInOut)); TweenChain upDownChain = new TweenChain(); upDownChain.setIterations(-1); upDownChain.append(up); upDownChain.append(down); Go.addTween(upDownChain); upDownChain.play(); }
/// <summary> /// adds an AbstractTween (Tween, TweenChain or TweenFlow) to the current list of running Tweens /// </summary> public static void addTween( AbstractTween tween ) { // early out for invalid items if( !tween.isValid() ) return; // dont add the same tween twice if( _tweens.Contains( tween ) ) return; // check for dupes and handle them before adding the tween. we only need to check for Tweens if( duplicatePropertyRule != DuplicatePropertyRuleType.None && tween is Tween ) { // if handleDuplicatePropertiesInTween returns true it indicates we should not add this tween if( handleDuplicatePropertiesInTween( tween as Tween ) ) return; // if we became invalid after handling dupes dont add the tween if( !tween.isValid() ) return; } _tweens.Add( tween ); // enable ourself if we are not enabled if( !instance.enabled ) // purposely using the static instace property just once for initialization _instance.enabled = true; // if the Tween isn't paused and it is a "from" tween jump directly to the start position if( tween is Tween && ((Tween)tween).isFrom && tween.state != TweenState.Paused ) tween.update( 0 ); // should we start up the time scale independent update? if( !_instance._timeScaleIndependentUpdateIsRunning && tween.updateType == UpdateType.TimeScaleIndependentUpdate ) _instance.StartCoroutine( _instance.timeScaleIndependentUpdate() ); }
void OnTweenComplete(AbstractTween obj) { RemoveFromArea(); }
void LoadGamePage(AbstractTween hurr) { BaseMain.Instance.GoToPage(BPageType.InGamePage); }
public void DoneTurning(AbstractTween tween) { isTurning = false; }
public void OnFinalNoteLabelFinishedAppearing(AbstractTween tween) { finalNoteAnimating = false; finalNoteShowing = true; }
public static void OnOldSceneCompletedFadingOut(AbstractTween tween) { FStage oldScene = (tween as Tween).target as FStage; Futile.RemoveStage(oldScene); }
void HandleMathModeCloseComplete(AbstractTween obj) { _isMathMode = false; Keeper.instance.slotList.Reorder(true, false); }
public void OnTutorialLabelFinishedEnlarging(AbstractTween tween) { tutorialLabelIsAnimating = false; }
public void HandleRemove(AbstractTween tween) { FSprite s = (tween as Tween).target as FSprite; s.SetPosition((Vector2)s.data); s.data = null; }
public void HandleActuallyReceivedDrink(AbstractTween tween) { currentSittableComponent.EjectDrinker(); isReceivingDrink = false; }
public void OnTutorialLabelFinishedShrinking(AbstractTween tween) { tutorialLabelIsAnimating = false; tutorialLabelHiddenTimer = 0; tutorialStringIndex++; }
public void StartingToAnimateLabelOut(AbstractTween tween) { labelIsAnimating = true; labelIsInPlace = false; }
public void DoneMovingLabelIntoPlace(AbstractTween tween) { labelIsAnimating = false; labelIsInPlace = true; }
public void OnSceneFadedOut(AbstractTween tween) { readyToStartOver = true; Go.to(startOverLabel, 0.3f, new TweenConfig().floatProp("alpha", 1.0f)); }
public void HandlePlacement(AbstractTween tween) { FSprite s = (tween as Tween).target as FSprite; s.data = s.GetPosition(); }
private static void HandleExplodeSpriteComplete(AbstractTween tween) { FSprite explodeSprite = (tween as Tween).target as FSprite; explodeSprite.RemoveFromContainer(); }
void HandleMathModeOpenComplete(AbstractTween obj) { }
/// <summary> /// removes the Tween returning true if it was removed or false if it was not found /// </summary> public static bool removeTween( AbstractTween tween ) { if( _tweens.Contains( tween ) ) { _tweens.Remove( tween ); if( _tweens.Count == 0 ) { // disable ourself if we have no more tweens instance.enabled = false; } return true; } return false; }
public void HandleDoneMovingToDirection(AbstractTween tween) { directionState = DirectionState.Static; owner.isBeingControlledByDirectionComponent = false; }
public void HandleWordDoneDismissing(AbstractTween tween) { FSprite word = (tween as Tween).target as FSprite; if ((int)word.data == 0) { word1out = true; } else if ((int)word.data == 1) { word2out = true; } if (player1Ready && player2Ready && word1out && word2out && !isSwitchingScenes) { WTMain.SwitchToScene(SceneType.GameScene); isSwitchingScenes = true; } }
void hurr(AbstractTween hurr) { menuElements[menuIndex].label.color = tone2; inputEnabled = true; }
public void HandleWordFinishedComingIn(AbstractTween tween) { FSprite word = (tween as Tween).target as FSprite; ShakeWord(word); if ((int)word.data == 0) { } else if ((int)word.data == 1) { introIsDone = true; //Go.to(helpLabel, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(player1, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(player2, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(ready1, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(ready2, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(inGameHelp, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(inGameHelpToggle, 0.5f, new TweenConfig().floatProp("alpha", 1)); #if ARCADE_VERSION Go.to(arcadeButtonsReady1, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(arcadeButtonsReady2, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(arcadeButtonsHelpLabels, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(arcadeButtonsTutorial, 0.5f, new TweenConfig().floatProp("alpha", 1)); #else Go.to(labelReady1, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(labelReady2, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(helpLabel, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to(tutorialKeyLabel, 0.5f, new TweenConfig().floatProp("alpha", 1)); #endif Go.to(tutorialLabel, 0.5f, new TweenConfig().floatProp("alpha", 1)); Go.to (creditLabel, 0.5f, new TweenConfig().floatProp("alpha", 1)); /*Tween fadeOut = new Tween(helpLabel, 0.15f, new TweenConfig().floatProp("alpha", 0)); Tween fadeIn = new Tween(helpLabel, 0.15f, new TweenConfig().floatProp("alpha", 1)); TweenChain chain = new TweenChain(); chain.setIterations(-1); chain.appendDelay(0.3f); chain.append(fadeOut); chain.append(fadeIn); Go.addTween(chain); chain.play();*/ } }
public void HandleWordFinishedShake(AbstractTween tween) { FSprite word = (tween as Tween).target as FSprite; ShakeWord(word); }
private static void HandleRemoveWhenDoneTweenComplete(AbstractTween tween) { ((tween as Tween).target as FNode).RemoveFromContainer(); }
public static void HandleDoneLeavingBathroom(AbstractTween tween) { SBDrinker drinker = (tween as Tween).target as SBDrinker; drinker.isLeavingBathroom = false; drinker.VelocityComponent().xVelocity = 0; drinker.VelocityComponent().yVelocity = 0; }
public TweenFlowItem( float startTime, AbstractTween tween ) { this.tween = tween; this.startTime = startTime; this.duration = tween.totalDuration; }