public override void update(IComponent component) { BackgroundComponent background = component as BackgroundComponent; if (!initialized) { resetBackground(background); initializeBackground(background); initialized = true; } Vector2 temp = new Vector2(); temp.X = (distance.X / transition.Interval); temp.Y = (distance.Y / transition.Interval); int x = (int)(defaultVector.X - background.Vector.X); int y = (int)(defaultVector.Y - background.Vector.Y); if (((Math.Abs(x) < Math.Abs(temp.X)) || (Math.Abs(y) < Math.Abs(temp.Y))) && transition.State == TransitionState.intro) { background.Vector = defaultVector; } else { background.Vector += temp; } transition.update(component); }
public void updateTransitions(TransitionState state) { switch (state) { case TransitionState.intro: if (intro != null) { intro.update(this); } break; case TransitionState.selected: if (select != null) { select.update(this); } break; case TransitionState.exit: if (exit != null) { exit.update(this); } break; } }
public override void update(IComponent component) { TitleComponent title = component as TitleComponent; if (!initialized) { resetTitle(title); initializeTitle(title); initialized = true; } Vector2 temp = new Vector2(); temp.X = (distance.X / transition.Interval); temp.Y = (distance.Y / transition.Interval); int x = (int)(defaultVector.X - title.TitleVector.X); int y = (int)(defaultVector.Y - title.TitleVector.Y); if (((Math.Abs(x) < Math.Abs(temp.X)) || (Math.Abs(y) < Math.Abs(temp.Y))) && transition.State == TransitionState.intro) { title.TitleVector = defaultVector; } else { title.TitleVector += temp; } transition.update(component); }
public override void update(IComponent component) { OptionsComponent options = component as OptionsComponent; if (!initialized) { resetOptions(options); initializeOptions(options); initialized = true; } setOptions(options); transition.update(component); }
public override void update(IComponent component) { TitleComponent title = component as TitleComponent; if (!initialized) { resetTitle(title); initializeTitle(title); initialized = true; } int x = 255 - alpha; int y = direction / transition.Interval; if (x >= y) { alpha += direction / transition.Interval; } setAlpha(title); transition.update(component); }
public override void update(IComponent component) { BackgroundComponent background = component as BackgroundComponent; if (!initialized) { resetBackground(background); initializeBackground(background); initialized = true; } int x = 255 - alpha; int y = direction / transition.Interval; if (x >= y) { alpha += direction / transition.Interval; } setAlpha(background); transition.update(component); }
public override void update(IComponent component) { OptionsComponent options = component as OptionsComponent; if (!initialized) { resetOptions(options); initializeOptions(options); initialized = true; } int x = 255 - alpha; int y = direction / transition.Interval; if (x >= y) { alpha += direction / transition.Interval; } setAlpha(options); transition.update(component); }