public Effector(Form form) : base(true) { this.Form = form; Dead = false; Initialize(); Initialized = true; }
/// <summary> /// Attach this effector to a form only if it isn't already. /// </summary> /// <param name="form"></param> public void AttachTo(Form form) { if (this.Form != null) throw new ArgumentException("This effector is already attached to a form."); this.Form = form; Initialize(); Initialized = true; }
/// <summary> /// Prepare an animation to play after a certain button is pressed. /// </summary> /// <param name="updater"></param> /// <param name="renderer"></param> /// <param name="animationName"></param> /// <param name="animation"></param> /// <param name="floatDuration"></param> /// <param name="floatTension"></param> /// <param name="mainButton"></param> /// <param name="otherButtons"></param> private void PrepareOnButtonClick( Action updater, Action renderer, string animationName, Form animation, int floatDuration, float floatTension, string mainButton, params string[] otherButtons) { // Resetting the timer makes it easier to align time based events in the // transition-out, since it's easier to let the initial time be zero than // it is to be anything else. ResetTime(); SetUpdater(updater); SetRenderer(renderer); RegisterForm(animationName, animation); GetForm(mainButton).AddEffector( new FloatToPositionEffector( DisplayManager.WindowResolution.Center, floatDuration, floatTension ) ); GetForm<GUIButton>(mainButton).LockInteraction(); foreach (var name in otherButtons) { GetForm(name).AddEffector(new FadeOutEffector(15)); } Manager.GetActiveMultiform<ForegroundContentMultiform>( ForegroundContentMultiform.MultiformName).HideCursor(); }