void expand(EasingTypes easing, int delay = animation_delay) { expanded = true; layerLeft.MoveTo(new Vector2(layer_left_active, layerLeft.Position.Y), delay, easing); icon.MoveTo(new Vector2(layer_left_active / centre_offset, icon.Position.Y), delay, easing); layerRight.MoveTo(new Vector2(layer_right_active + layerRightTextAllowance, layerRight.Position.Y), delay, easing); text.MoveTo(new Vector2((layer_right_active + layerRightTextAllowance - layer_left_active) / centre_offset + layer_left_active, text.Position.Y), delay, easing); layerLeft.FadeColour(colour_active, delay, false, easing); }
private void DoPositionUpdate() { if (Visible) { current = Math.Min(max, Math.Max(min, min + (double)(InputManager.CursorPoint.X - activeRectangle.Left) / activeRectangle.Width * (max - min))); seekbar1.StartPosition = new Vector2((float)(position.X + ((current - min) / (max - min)) * length), position.Y); seekbar1.MoveTo(seekbar1.StartPosition, 50); } }
internal BeatmapPanel(Beatmap beatmap) { backingPlate = pSprite.FullscreenWhitePixel; backingPlate.Alpha = 1; backingPlate.AlwaysDraw = true; backingPlate.Colour = Color4.OrangeRed; backingPlate.Scale.Y = 80; backingPlate.Scale.X *= 0.8f; backingPlate.DrawDepth = 0.8f; SpriteCollection.Add(backingPlate); this.beatmap = beatmap; backingPlate.OnClick += delegate { backingPlate.MoveTo(backingPlate.Position - new Vector2(50, 0), 600); backingPlate.Transform(new Transformation(TransformationType.VectorScale, backingPlate.Scale, new Vector2(backingPlate.Scale.X * 1.2f, backingPlate.Scale.Y), backingPlate.ClockingNow, backingPlate.ClockingNow + 600)); backingPlate.UnbindAllEvents(); Player.SetBeatmap(beatmap); Director.ChangeMode(OsuMode.Play); }; backingPlate.HandleClickOnUp = true; backingPlate.OnHover += delegate { backingPlate.Colour = Color4.YellowGreen; }; backingPlate.OnHoverLost += delegate { backingPlate.Colour = Color4.OrangeRed; }; text = new pText(Path.GetFileNameWithoutExtension(beatmap.BeatmapFilename), 18, Vector2.Zero, Vector2.Zero, 1, true, Color4.White, false); SpriteCollection.Add(text); }
internal virtual void SlideOut() { s_barFill.FadeOut(500); s_barBg.FadeOut(500); s_kiIcon.FadeOut(500); if (lastExplode != null) { lastExplode.FadeOut(50); } Vector2 off = new Vector2(0, 20); s_barFill.MoveTo(s_barFill.InitialPosition - off, 500); s_barBg.MoveTo(s_barBg.InitialPosition - off, 500); s_kiIcon.InitialPosition = new Vector2(s_kiIcon.Position.X, s_kiIcon.InitialPosition.Y); s_kiIcon.Transformations.Add(new Transformation(TransformationType.Scale, 1, 1.6f, GameBase.Time, GameBase.Time + 500)); }
internal void UpdateScores() { if (!accuracyMatch) { bool comboHack = PlayerVs.Match.matchScoringType == MatchScoringTypes.Combo; int team1 = comboHack ? getTeamCombo(SlotTeams.Blue) : getTeamScore(SlotTeams.Blue); int team2 = comboHack ? getTeamCombo(SlotTeams.Red) : getTeamScore(SlotTeams.Red); team1display.Update(team1); team2display.Update(team2); //Accuracy is shown too... team1display.Update(getTeamAccuracy(SlotTeams.Blue) * 100); team2display.Update(getTeamAccuracy(SlotTeams.Red) * 100); //team1score.Text = team1.ToString("00000000"); //team2score.Text = team2.ToString("00000000"); bool teamBlueWinner = (team1 > team2 && !PlayerVs.TeamFailed(SlotTeams.Blue)) || PlayerVs.TeamFailed(SlotTeams.Red); float offset = teamBlueWinner ? -Math.Min(300, ((float)team1 / Math.Max(1, team2) - 1) * 100) : Math.Min(300, ((float)team2 / Math.Max(1, team1) - 1) * 100); float x = GameBase.WindowManager.WidthScaled / 2 + offset; metre.MoveTo(new Vector2(x, 90), 1000, EasingTypes.Out); metre2.MoveTo(new Vector2(x, 90), 1000, EasingTypes.Out); } else { float team1 = getTeamAccuracy(SlotTeams.Blue); float team2 = getTeamAccuracy(SlotTeams.Red); team1display.Update(team1 * 100); team2display.Update(team2 * 100); float offset = team1 > team2 ? -Math.Min(300, ((float)team1 / Math.Max(1, team2) - 1) * 300) : Math.Min(300, ((float)team2 / Math.Max(1, team1) - 1) * 300); float x = GameBase.WindowManager.WidthScaled / 2 + offset; metre.MoveTo(new Vector2(x, 90), 1000, EasingTypes.Out); metre2.MoveTo(new Vector2(x, 90), 1000, EasingTypes.Out); } }
internal override void AddMeter(HitObject h, int?customDelta) { float error = customDelta ?? AudioEngine.Time - h.StartTime; nextFadeTime = AudioEngine.Time + fade_delay; Show(); if (error < 0) { error = Math.Max(error, -ErrorRange); } else { error = Math.Min(error, ErrorRange); } float pos = error / ErrorRange * (Width / 2); floatingError = floatingError * 0.8f + pos * 0.2f; arrow.MoveTo(new Vector2(CentrePosition.X + floatingError, arrow.InitialPosition.Y), 800, EasingTypes.Out); error = Math.Abs(error); const float width = 3; pSprite a = centre.Clone(); a.Clock = Clocks.AudioOnce; a.AlwaysDraw = false; a.Depth = 0.85f; a.InitialColour = error < hitObjectManager.HitWindow300 ? colour300 : (error < hitObjectManager.HitWindow100 ? colour100 : colour50); a.Position.X = CentrePosition.X + pos; a.VectorScale.X = width; a.Alpha = 0.4f; a.Additive = true; a.FadeOut(10000); spriteManager.Add(a); }
internal virtual void Resort() { for (int i = 0; i < Tabs.Count; i++) { pTab t = Tabs[i]; Vector2 position = new Vector2(BottomLeft.X + (i % MaxTabsWide) * pTab.TAB_WIDTH * (RightToLeft ? -1 : 1) + ((i / MaxTabsWide) % 2) * secondRowOffset, BottomLeft.Y + 6 - 14 - (separationHeight * (i / MaxTabsWide))); float depth = baseDepth - i * 0.0002f - (i / MaxTabsWide) * 0.0001F; t.SpriteCollection[0].HoverPriority = (int)(-100 + depth * 100); for (int j = 0; j < t.SpriteCollection.Count; j++) { pSprite sprite = t.SpriteCollection[j]; sprite.InitialPosition = position; sprite.MoveTo(position, 300, EasingTypes.OutElasticQuarter); sprite.Depth = depth + 0.0001f * j + (SelectedTab == t ? 0.001f : 0); } } SpriteManager.ResortDepth(); }
internal void MoveTo(Vector2 location) { text.MoveTo(location + new Vector2(0, 10), 400); backingPlate.MoveTo(location, 400); }