internal void BeginSwitch(bool increase) { if (isSwitching) { return; } isSwitching = true; this.increase = increase; arrowSmall.ScaleScalar = 0.5f; arrowLarge.ScaleScalar = 1; spriteManager.Sprites.ForEach(s => s.Transformations.Clear()); text.ScaleScalar = 1; ((pSprite)text).Texture = TextureManager.Load(increase ? OsuTexture.stream_changing_up : OsuTexture.stream_changing_down); Transformation fadeIn = new TransformationF(TransformationType.Fade, 0, 1, Clock.ModeTime, Clock.ModeTime + 300); text.Transform(fadeIn); if (increase) { arrowSmall.Rotation = 0; arrowLarge.Rotation = 0; } else { arrowSmall.Rotation = MathHelper.Pi; arrowLarge.Rotation = MathHelper.Pi; } const int animation_length = 2000; Transformation smallMove = new TransformationV(new Vector2(0, increase ? 10 : -10), new Vector2(0, increase ? -10 : 10), Clock.ModeTime, Clock.ModeTime + animation_length); smallMove.Looping = true; Transformation largeMove = new TransformationV(new Vector2(0, increase ? 5 : -5), new Vector2(0, increase ? -5 : 5), Clock.ModeTime, Clock.ModeTime + animation_length); largeMove.Looping = true; Transformation fade1 = new TransformationF(TransformationType.Fade, 0, 0.5f, Clock.ModeTime, Clock.ModeTime + animation_length / 2) { Looping = true, LoopDelay = animation_length / 2 }; Transformation fade2 = new TransformationF(TransformationType.Fade, 0.5f, 0, Clock.ModeTime + animation_length / 2, Clock.ModeTime + animation_length) { Looping = true, LoopDelay = animation_length / 2 }; arrowLarge.Transform(largeMove, fade1, fade2); arrowSmall.Transform(smallMove, fade1, fade2); }
internal HitCircle(HitObjectManager hit_object_manager, Vector2 pos, int startTime, bool newCombo, int comboOffset, HitObjectSoundType soundType) : base(hit_object_manager, pos, startTime, soundType, newCombo, comboOffset) { Type = HitObjectType.Circle; Color4 white = Color4.White; SpriteHitCircle1 = new pSprite(TextureManager.Load(OsuTexture.hitcircle0), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(StartTime), false, white); Sprites.Add(SpriteHitCircle1); //SpriteHitCircle1.TagNumeric = 1; SpriteHitCircle1.TagNumeric = DIMMABLE_TAG; SpriteHitCircleText = new pSpriteText(null, "default", 3, //SkinManager.Current.FontHitCircle, SkinManager.Current.FontHitCircleOverlap, FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(StartTime - 1), false, white); SpriteHitCircleText.TextConstantSpacing = false; SpriteHitCircleText.TagNumeric = DIMMABLE_TAG; SpriteApproachCircle = new ApproachCircle(Position, 1, false, 1, white); SpriteApproachCircle.Clocking = ClockTypes.Audio; Sprites.Add(SpriteApproachCircle); if (ShowCircleText) { Sprites.Add(SpriteHitCircleText); } SpriteApproachCircle.Transform(new TransformationF(TransformationType.Fade, 0, 0.9F, startTime - DifficultyManager.PreEmpt, Math.Min(startTime, startTime - DifficultyManager.PreEmpt + DifficultyManager.FadeIn * 2))); SpriteApproachCircle.Transform(new TransformationF(TransformationType.Scale, 4, 1, startTime - DifficultyManager.PreEmpt, startTime)); SpriteApproachCircle.Transform(new TransformationF(TransformationType.Fade, 0.9f, 0, startTime, startTime + (int)(DifficultyManager.PreEmpt * 0.1f))); Transformation fadeIn = new TransformationF(TransformationType.Fade, 0, 1, startTime - DifficultyManager.PreEmpt, startTime - DifficultyManager.PreEmpt + DifficultyManager.FadeIn); SpriteHitCircle1.Transform(fadeIn); SpriteHitCircleText.Transform(fadeIn); Transformation fadeOut = new TransformationF(TransformationType.Fade, 1, 0, startTime, startTime + DifficultyManager.HitWindow50); SpriteHitCircle1.Transform(fadeOut); SpriteHitCircleText.Transform(fadeOut); }
private void transferToMainCounter() { displayComboMainCounter = s_hitCombo_Incoming.TagNumeric; s_hitCombo.TagNumeric = s_hitCombo_Incoming.TagNumeric; s_hitCombo.TextArray = s_hitCombo_Incoming.TextArray; s_hitCombo.Transformations.RemoveAll(tr => tr.Type == TransformationType.Scale); Transformation t1 = new TransformationF(TransformationType.Scale, 1.28F, 1.4F, Clock.Time, Clock.Time + 50); t1.Easing = EasingTypes.Out; s_hitCombo.Transformations.Add(t1); t1 = new TransformationF(TransformationType.Scale, 1.4f, 1.28F, Clock.Time + 50, Clock.Time + 100); t1.Easing = EasingTypes.In; s_hitCombo.Transformations.Add(t1); }
protected override void endTracking() { inactiveOverlay.FadeIn(80); circularProgress.FadeOut(80); circularProgress.AlwaysDraw = false; Transformation returnto = new TransformationF(TransformationType.Scale, spriteCollectionStart[0].ScaleScalar, 1, ClockingNow, ClockingNow + 150, EasingTypes.In); foreach (pDrawable p in spriteCollectionStart) { p.Transformations.RemoveAll(t => t.Type == TransformationType.Scale); p.Transform(returnto); } border.Transformations.RemoveAll(t => t.Type == TransformationType.Scale); border.Transform(returnto); }
public override void Update() { osuLogoGloss.Rotation = -menuBackgroundNew.Rotation; if (AudioEngine.Music != null && AudioEngine.Music.IsElapsing) { elapsedRotation += Clock.ElapsedMilliseconds; osuLogo.Rotation += (float)(Math.Cos((elapsedRotation) / 1000f) * 0.0001 * Clock.ElapsedMilliseconds); TransformationF tr = menuBackgroundNew.Transformations.Find(t => t.Type == TransformationType.Rotation) as TransformationF; float rCh = -(float)(Math.Cos((elapsedRotation + 500) / 3000f) * 0.00002 * Clock.ElapsedMilliseconds); if (tr != null) { tr.EndFloat += rCh; } else { menuBackgroundNew.Rotation += rCh; } tr = menuBackgroundNew.Transformations.Find(t => t.Type == TransformationType.Scale) as TransformationF; float sCh = (float)(Math.Cos((elapsedRotation + 500) / 4000f) * 0.00002 * Clock.ElapsedMilliseconds); if (tr != null) { tr.EndFloat += sCh; } else { menuBackgroundNew.ScaleScalar += sCh; } } if (State != MenuState.Select) { updateBeat(); } base.Update(); spriteManagerBehind.Update(); menuBackgroundNew.Update(); osuLogoGloss.ScaleScalar = osuLogo.ScaleScalar; }
protected virtual void OnIncrease(int currentCombo) { displayCombo++; if (s_hitCombo.TagNumeric != s_hitCombo_Incoming.TagNumeric) { transferToMainCounter(); } s_hitCombo_Incoming.Transformations.Clear(); Transformation t1 = new TransformationF(TransformationType.Scale, 2F, 1.28F, Clock.Time, Clock.Time + 300); Transformation t2 = new TransformationF(TransformationType.Fade, 0.6F, 0, Clock.Time, Clock.Time + 300); s_hitCombo_Incoming.Transform(t1); s_hitCombo_Incoming.Transform(t2); }
internal override void HitAnimation(ScoreChange action, bool animateNumber = false) { SpriteHitCircle1.Transformations.Clear(); SpriteHitCircleText.Transformations.Clear(); SpriteApproachCircle.Transformations.Clear(); if (connectedObject != null) { connectionSprite.FadeOut(100); } int now = SpriteHitCircle1.ClockingNow; if (action > ScoreChange.Miss) { //Fade out the actual hit circle Transformation circleScaleOut = new TransformationF(TransformationType.Scale, 1.1F, 1.4F, now, now + DifficultyManager.FadeOut, EasingTypes.InHalf); Transformation textScaleOut = new TransformationF(TransformationType.Scale, 1.1F, 1.4F, now, now + DifficultyManager.FadeOut, EasingTypes.InHalf); Transformation circleFadeOut = new TransformationF(TransformationType.Fade, 1, 0, now, now + DifficultyManager.FadeOut); SpriteHitCircle1.Transformations.Clear(); SpriteHitCircle1.Transform(circleScaleOut); SpriteHitCircle1.Transform(circleFadeOut); SpriteHitCircleText.Transformations.Clear(); if (animateNumber) { SpriteHitCircleText.Transform(textScaleOut); SpriteHitCircleText.Transform(circleFadeOut); } } base.HitAnimation(action); }
private void osuLogo_OnClick(object sender, EventArgs e) { State = MenuState.Select; osuLogo.HandleInput = false; osuLogo.Transformations.Clear(); AudioEngine.PlaySample(OsuSamples.MenuHit); menuBackgroundNew.BeAwesome(); Transformation fadeIn = new TransformationF(TransformationType.Fade, 0, 0.98f, Clock.ModeTime + 1300, Clock.ModeTime + 1700); osuLogoSmall.Transform(fadeIn); Transformation move = new TransformationV(new Vector2(0, 50), Vector2.Zero, Clock.ModeTime + 500, Clock.ModeTime + 1000, EasingTypes.In); fadeIn = new TransformationF(TransformationType.Fade, 0, 0.98f, Clock.ModeTime + 500, Clock.ModeTime + 1000); NewsButton.Transform(fadeIn); NewsButton.Transform(move); osuLogo.Transformations.Clear(); osuLogo.Transform(new TransformationF(TransformationType.Scale, osuLogo.ScaleScalar, osuLogo.ScaleScalar * 2.4f, Clock.ModeTime, Clock.ModeTime + 1300, EasingTypes.InDouble)); osuLogo.Transform(new TransformationF(TransformationType.Rotation, osuLogo.Rotation, 0.35f, Clock.ModeTime, Clock.ModeTime + 1000, EasingTypes.In)); osuLogoGloss.Transformations.Clear(); osuLogoGloss.FadeOut(200); osuLogoGloss.Transform(new TransformationF(TransformationType.Scale, osuLogoGloss.ScaleScalar, osuLogoGloss.ScaleScalar * 2.4f, Clock.ModeTime, Clock.ModeTime + 1300, EasingTypes.InDouble)); stream.FadeOut(150); additiveStream.FadeOut(150); osuLogo.FadeOut(800); explosions.ForEach(s => { s.Transformations.Clear(); s.FadeOut(100); }); }
internal void burstEndpoint() { int duration = (EndTime - StartTime) / RepeatCount; int now = spriteCollectionStart[0].ClockingNow; Transformation bounce = new TransformationF(TransformationType.Scale, 1.1f + 0.4f * progressCurrent / RepeatCount, 1 + 0.3f * progressCurrent / RepeatCount, now, now + duration, EasingTypes.In ); foreach (pDrawable p in spriteCollectionStart) { p.Transformations.RemoveAll(b => b.Type == TransformationType.Scale); p.Transform(bounce); } border.Transformations.RemoveAll(b => b.Type == TransformationType.Scale); border.Transform(bounce); }
protected override void initializeSprites() { Transformation fadeInTrack = new TransformationF(TransformationType.Fade, 0, 1, StartTime - DifficultyManager.PreEmpt, StartTime - DifficultyManager.PreEmpt + DifficultyManager.FadeIn); Transformation fadeOut = new TransformationF(TransformationType.Fade, 1, 0, EndTime, EndTime + DifficultyManager.HitWindow50); activeOverlay = new pSprite(TextureManager.Load(OsuTexture.holdactive), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 18), false, Color.White); spriteCollectionStart.Add(activeOverlay); inactiveOverlay = new pSprite(TextureManager.Load(OsuTexture.holdinactive), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 19), false, Color.White); inactiveOverlay.Transform(new NullTransform(StartTime, EndTime)); spriteCollectionStart.Add(inactiveOverlay); border = new pSprite(TextureManager.Load(OsuTexture.holdoverlay), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 20), false, Color.White); border.Transform(fadeInTrack); border.Transform(fadeOut); Sprites.Add(border); spriteCollectionStart.ForEach(s => s.Transform(fadeInTrack)); spriteCollectionStart.ForEach(s => s.Transform(fadeOut)); circularProgress = new CircularProgress(position, 4, false, 0, Color.White); circularProgress.Clocking = ClockTypes.Audio; circularProgress.Field = FieldTypes.GamefieldExact; circularProgress.Additive = true; circularProgress.Transform(new NullTransform(StartTime, EndTime)); spriteCollectionStart.Add(circularProgress); Sprites.AddRange(spriteCollectionStart); activeOverlay.Transform(new TransformationC(hold_colour, Color4.White, StartTime, EndTime)); circularProgress.Transform(new TransformationC(new Color4(hold_colour.R, hold_colour.G, hold_colour.B, 0.8f), ColourHelper.Lighten(new Color4(hold_colour.R, hold_colour.G, hold_colour.B, 0.8f), 0.5f), StartTime, EndTime)); border.TagNumeric = HitObject.DIMMABLE_TAG; inactiveOverlay.TagNumeric = HitObject.DIMMABLE_TAG; }
public override void Initialize() { int initial_display = firstDisplay ? 2950 : 0; //spriteManagerBehind.Add(menuBackground); menuBackgroundNew = new MenuBackground(); menuBackgroundNew.Clocking = ClockTypes.Mode; const int logo_stuff_v_offset = -20; Transformation logoBounce = new TransformationBounce(initial_display, initial_display + 2000, 0.625f, 0.4f, 2); osuLogo = new pSprite(TextureManager.Load(OsuTexture.menu_osu), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(0, logo_stuff_v_offset), 0.9f, true, Color4.White); osuLogo.Transform(logoBounce); osuLogo.OnClick += osuLogo_OnClick; menuBackgroundNew.Add(osuLogo); //gloss osuLogoGloss = new pSprite(TextureManager.Load(OsuTexture.menu_gloss), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(0, logo_stuff_v_offset), 0.91f, true, Color4.White); osuLogoGloss.Additive = true; menuBackgroundNew.Add(osuLogoGloss); Transformation explosionFade = new TransformationF(TransformationType.Fade, 0, 1, initial_display + 500, initial_display + 700); pSprite explosion = new pSprite(TextureManager.Load(OsuTexture.menu_circle), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(-90 * 0.625f, -90 * 0.625f + logo_stuff_v_offset), 0.8f, true, new Color4(112, 58, 144, 255)); explosion.ScaleScalar = sizeForExplosion(0); explosion.Transform(explosionFade); explosions.Add(explosion); menuBackgroundNew.Add(explosion); explosion = new pSprite(TextureManager.Load(OsuTexture.menu_circle), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(170 * 0.625f, 10 * 0.625f + logo_stuff_v_offset), 0.8f, true, new Color4(242, 25, 138, 255)); explosion.ScaleScalar = sizeForExplosion(1); explosion.Transform(explosionFade); explosions.Add(explosion); menuBackgroundNew.Add(explosion); explosion = new pSprite(TextureManager.Load(OsuTexture.menu_circle), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(-130 * 0.625f, 88 * 0.625f + logo_stuff_v_offset), 0.8f, true, new Color4(254, 148, 4, 255)); explosion.ScaleScalar = sizeForExplosion(2); explosion.Transform(explosionFade); explosions.Add(explosion); menuBackgroundNew.Add(explosion); Transformation fadeIn = new TransformationF(TransformationType.Fade, 0, 1, initial_display, initial_display); spriteManager.Sprites.ForEach(s => s.Transform(fadeIn)); stream = new pSprite(TextureManager.Load(OsuTexture.menu_stream), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(0, 180), 0.95f, true, Color4.White); stream.Transform(new TransformationF(TransformationType.Fade, 0, 1, initial_display + 900, initial_display + 1300)); spriteManager.Add(stream); additiveStream = stream.Clone(); additiveStream.Additive = true; additiveStream.DrawDepth = 0.96f; additiveStream.Transform(new TransformationF(TransformationType.Fade, 0, 1, initial_display + 1000, initial_display + 1200) { Looping = true, LoopDelay = 5000 }); additiveStream.Transform(new TransformationF(TransformationType.Fade, 1, 0, initial_display + 1200, initial_display + 2000) { Looping = true, LoopDelay = 4400 }); spriteManager.Add(additiveStream); osuLogoSmall = new pSprite(TextureManager.Load(OsuTexture.menu_logo), FieldTypes.Standard, OriginTypes.TopLeft, ClockTypes.Mode, new Vector2(5, 5), 0.9f, true, Color4.White); osuLogoSmall.OnClick += delegate { if (State == MenuState.Select) { Director.ChangeMode(OsuMode.MainMenu); } }; osuLogoSmall.Alpha = 0; spriteManager.Add(osuLogoSmall); NewsButton = new NewsButton(); spriteManager.Add(NewsButton); NewsButton.Alpha = 0; menuBackgroundNew.Transform(fadeIn); osuLogo.Transform(fadeIn); InitializeBgm(); menuBackgroundNew.Transform(new TransformationBounce(initial_display, initial_display + 2000, menuBackgroundNew.ScaleScalar, 0.8f, 2)); if (firstDisplay) { pDrawable whiteLayer = pSprite.FullscreenWhitePixel; whiteLayer.Alpha = 0; whiteLayer.Clocking = ClockTypes.Mode; spriteManager.Add(whiteLayer); whiteLayer.Transform(new TransformationF(TransformationType.Fade, 0, 0.125f, 800, initial_display - 200)); whiteLayer.Transform(new TransformationF(TransformationType.Fade, 0.125f, 1f, initial_display - 200, initial_display)); whiteLayer.Transform(new TransformationF(TransformationType.Fade, 1, 0, initial_display, initial_display + 1200, EasingTypes.In)); pSprite headphones = new pSprite(TextureManager.Load(OsuTexture.menu_headphones), FieldTypes.StandardSnapCentre, OriginTypes.Centre, ClockTypes.Mode, new Vector2(0, 0), 0.9f, false, Color4.White); headphones.Additive = true; headphones.Transform(new TransformationF(TransformationType.Fade, 0, 1, 50, 200)); headphones.Transform(new TransformationF(TransformationType.Fade, 1, 1, 1000, initial_display)); spriteManager.Add(headphones); #if !DIST headphones.OnClick += delegate { GameBase.Mapper = true; pText t = new pText("ENABLED MAPPER MODE", 24, new Vector2(0, 30), 1, false, Color4.Red) { Field = FieldTypes.StandardSnapTopCentre, Origin = OriginTypes.Centre }; t.FadeOutFromOne(1500); spriteManager.Add(t); }; #endif pDrawable add = headphones.Clone(); add.Additive = true; add.Transform(new TransformationF(TransformationType.Fade, 0, 0.1f, 50, 200)); add.Transform(new TransformationF(TransformationType.Fade, 0.1f, 0.2f, 1000, initial_display)); add.Transform(new TransformationF(TransformationType.Scale, 1, 1.12f, 1000, initial_display, EasingTypes.Out)); spriteManager.Add(add); add = headphones.Clone(); add.Additive = true; add.Transform(new TransformationF(TransformationType.Fade, 0, 0.1f, 50, 200)); add.Transform(new TransformationF(TransformationType.Fade, 0.1f, 0.2f, 1000, initial_display)); add.Transform(new TransformationF(TransformationType.Scale, 1, 1.04f, 1000, initial_display, EasingTypes.Out)); spriteManager.Add(add); add = headphones.Clone(); add.Additive = true; add.Transform(new TransformationF(TransformationType.Fade, 0, 0.1f, 50, 200)); add.Transform(new TransformationF(TransformationType.Fade, 0.1f, 0.2f, 1000, initial_display)); add.Transform(new TransformationF(TransformationType.Scale, 1, 1.08f, 1000, initial_display, EasingTypes.Out)); spriteManager.Add(add); GameBase.Scheduler.Add(delegate { AudioEngine.PlaySample(OsuSamples.MainMenu_Intro); GameBase.Scheduler.Add(delegate { if (AudioEngine.Music != null) { AudioEngine.Music.Play(); } }, 2950); }, true); if (GameBase.Config.GetValue("firstrun", true)) { Notification notification = new Notification( LocalisationManager.GetString(OsuString.FirstRunWelcome), LocalisationManager.GetString(OsuString.FirstRunTutorial), NotificationStyle.YesNo, delegate(bool answer) { if (answer) { AudioEngine.PlaySample(OsuSamples.MenuHit); Director.ChangeMode(OsuMode.Tutorial); } GameBase.Config.SetValue("firstrun", false); GameBase.Config.SaveConfig(); }); GameBase.Scheduler.Add(delegate { GameBase.Notify(notification); }, initial_display + 1500); } } else { if (Director.LastOsuMode == OsuMode.Tutorial) { AudioEngine.Music.SeekTo(0); } AudioEngine.Music.Play(); } string username = GameBase.Config.GetValue <string>("username", null); bool hasAuth = GameBase.HasAuth; firstDisplay = false; }