public LanePlayfield(LanedHitLane type) { bool isAirLane = type == LanedHitLane.Air; lane = type; Name = $"{(isAirLane ? "Air" : "Ground")} Playfield"; Padding = new MarginPadding { Left = RushPlayfield.HIT_TARGET_OFFSET }; Anchor = Origin = isAirLane ? Anchor.TopCentre : Anchor.BottomCentre; RelativeSizeAxes = Axes.Both; Size = new Vector2(1, 0); AddRangeInternal(new Drawable[] { new Container { Name = "Hit Target", Anchor = Anchor.CentreLeft, Origin = Anchor.Centre, Size = new Vector2(RushPlayfield.HIT_TARGET_SIZE), Child = new SkinnableDrawable(new RushSkinComponent(isAirLane ? RushSkinComponents.AirHitTarget : RushSkinComponents.GroundHitTarget), _ => new HitTarget { RelativeSizeAxes = Axes.Both, }, confineMode: ConfineMode.ScaleToFit), }, effectsContainer = new Container(), judgementContainer = new JudgementContainer <DrawableJudgement>(), HitObjectContainer, }); }
public OsuPlayfield() { InternalChildren = new Drawable[] { connectionLayer = new FollowPointRenderer { RelativeSizeAxes = Axes.Both, Depth = 2, }, judgementLayer = new JudgementContainer <DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, }, // Todo: This should not exist, but currently helps to reduce LOH allocations due to unbinding skin source events on judgement disposal // Todo: Remove when hitobjects are properly pooled new LocalSkinOverrideContainer(null) { RelativeSizeAxes = Axes.Both, Child = HitObjectContainer, }, approachCircles = new ApproachCircleProxyContainer { RelativeSizeAxes = Axes.Both, Depth = -1, }, }; }
public OsuPlayfield() { Anchor = Anchor.Centre; Origin = Anchor.Centre; Size = new Vector2(0.75f); InternalChild = new PlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { connectionLayer = new FollowPointRenderer { RelativeSizeAxes = Axes.Both, Depth = 2, }, judgementLayer = new JudgementContainer <DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, }, HitObjectContainer, approachCircles = new Container { RelativeSizeAxes = Axes.Both, Depth = -1, }, } }; }
public CytosuPlayfield() { InternalChildren = new Drawable[] { judgementLayer = new JudgementContainer <DrawableCytosuJudgement> { RelativeSizeAxes = Axes.Both, }, HitObjectContainer, new PlayfieldBorder { RelativeSizeAxes = Axes.Both }, new ScanLine { Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 5000f, LineColour = Color4.White, } }; var hitWindows = new CytosuHitWindows(); foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r))) { poolDictionary.Add(result, new DrawableJudgementPool(result)); } AddRangeInternal(poolDictionary.Values); }
public SentakkiPlayfield() { RevolutionDuration.BindValueChanged(b => { if (b.NewValue != 0) { this.Spin(b.NewValue * 1000, RotationDirection.Clockwise).Then().Loop(); } }); Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.None; Size = new Vector2(600); AddRangeInternal(new Drawable[] { new VisualisationContainer(), ring = new SentakkiRing(), HitObjectContainer, judgementLayer = new JudgementContainer <DrawableSentakkiJudgement> { RelativeSizeAxes = Axes.Both, }, }); }
public OsuPlayfield() { InternalChildren = new Drawable[] { playfieldBorder = new PlayfieldBorder { RelativeSizeAxes = Axes.Both, Depth = 3 }, spinnerProxies = new ProxyContainer { RelativeSizeAxes = Axes.Both }, followPoints = new FollowPointRenderer { RelativeSizeAxes = Axes.Both, Depth = 2, }, judgementLayer = new JudgementContainer <DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, }, // Todo: This should not exist, but currently helps to reduce LOH allocations due to unbinding skin source events on judgement disposal // Todo: Remove when hitobjects are properly pooled new SkinProvidingContainer(null) { Child = HitObjectContainer, }, approachCircles = new ProxyContainer { RelativeSizeAxes = Axes.Both, Depth = -1, }, }; hitPolicy = new OrderedHitPolicy(HitObjectContainer); CheckHittable = hitPolicy.IsHittable; var hitWindows = new OsuHitWindows(); foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r))) { poolDictionary.Add(result, new DrawableJudgementPool(result)); } AddRangeInternal(poolDictionary.Values); NewResult += onNewResult; }
public SentakkiPlayfield() { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.None; Rotation = 0; Size = new Vector2(600); AddRangeInternal(new Drawable[] { new VisualisationContainer(), ring = new SentakkiRing(), HitObjectContainer, judgementLayer = new JudgementContainer <DrawableSentakkiJudgement> { RelativeSizeAxes = Axes.Both, }, }); }
public OsuPlayfield() { Anchor = Anchor.Centre; Origin = Anchor.Centre; InternalChildren = new Drawable[] { playfieldBorder = new PlayfieldBorder { RelativeSizeAxes = Axes.Both }, spinnerProxies = new ProxyContainer { RelativeSizeAxes = Axes.Both }, FollowPoints = new FollowPointRenderer { RelativeSizeAxes = Axes.Both }, judgementLayer = new JudgementContainer <DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both }, HitObjectContainer, judgementAboveHitObjectLayer = new Container { RelativeSizeAxes = Axes.Both }, approachCircles = new ProxyContainer { RelativeSizeAxes = Axes.Both }, }; HitPolicy = new StartTimeOrderedHitPolicy(); var hitWindows = new OsuHitWindows(); foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r))) { poolDictionary.Add(result, new DrawableJudgementPool(result, onJudgementLoaded)); } AddRangeInternal(poolDictionary.Values); NewResult += onNewResult; }
public OsuPlayfield() { InternalChildren = new Drawable[] { connectionLayer = new FollowPointRenderer { RelativeSizeAxes = Axes.Both, Depth = 2, }, judgementLayer = new JudgementContainer <DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, }, HitObjectContainer, approachCircles = new ApproachCircleProxyContainer { RelativeSizeAxes = Axes.Both, Depth = -1, }, }; }
public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) : base(ScrollingDirection.Up) { this.firstColumnIndex = firstColumnIndex; Name = "Stage"; Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { new Container { Name = "Columns mask", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Masking = true, Children = new Drawable[] { new Box { Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, columnFlow = new FillFlowContainer <Column> { Name = "Columns", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Left = 1, Right = 1 }, Spacing = new Vector2(1, 0) }, } }, new Container { Name = "Barlines mask", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Width = 1366, // Bar lines should only be masked on the vertical axis BypassAutoSizeAxes = Axes.Both, Masking = true, Child = content = new Container { Name = "Bar lines", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Padding = new MarginPadding { Top = HIT_TARGET_POSITION } } }, judgements = new JudgementContainer <DrawableManiaJudgement> { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Y = HIT_TARGET_POSITION + 150, BypassAutoSizeAxes = Axes.Both }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } }; for (int i = 0; i < definition.Columns; i++) { var isSpecial = definition.IsSpecialColumn(i); var column = new Column { IsSpecial = isSpecial, Action = isSpecial ? specialColumnStartAction++ : normalColumnStartAction++ }; AddColumn(column); } Inverted.ValueChanged += invertedChanged; Inverted.TriggerChange(); }
public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) { this.firstColumnIndex = firstColumnIndex; Name = "Stage"; Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { new Box { Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, columnFlow = new FillFlowContainer <Column> { Name = "Columns", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Left = COLUMN_SPACING, Right = COLUMN_SPACING }, }, new Container { Name = "Barlines mask", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Width = 1366, // Bar lines should only be masked on the vertical axis BypassAutoSizeAxes = Axes.Both, Masking = true, Child = barLineContainer = new HitObjectArea(HitObjectContainer) { Name = "Bar lines", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, } }, judgements = new JudgementContainer <DrawableManiaJudgement> { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Y = HIT_TARGET_POSITION + 150, }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } }; for (int i = 0; i < definition.Columns; i++) { var columnType = definition.GetTypeOfColumn(i); var column = new Column(firstColumnIndex + i) { ColumnType = columnType, AccentColour = columnColours[columnType], Action = { Value = columnType == ColumnType.Special ? specialColumnStartAction++ : normalColumnStartAction++ } }; AddColumn(column); } }
public TaikoPlayfield(ControlPointInfo controlPoints) : base(ScrollingDirection.Left) { AddRangeInternal(new Drawable[] { backgroundContainer = new Container { Name = "Transparent playfield background", RelativeSizeAxes = Axes.Both, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.2f), Radius = 5, }, Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.6f }, } }, new Container { Name = "Right area", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = left_area_size }, Children = new Drawable[] { new Container { Name = "Masked elements before hit objects", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Masking = true, Children = new Drawable[] { hitExplosionContainer = new Container <HitExplosion> { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Blending = BlendingMode.Additive, }, new HitTarget { Anchor = Anchor.CentreLeft, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit } } }, barlineContainer = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET } }, content = new Container { Name = "Hit objects", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Masking = true }, kiaiExplosionContainer = new Container <KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Margin = new MarginPadding { Left = HIT_TARGET_OFFSET }, Blending = BlendingMode.Additive }, judgementContainer = new JudgementContainer <DrawableTaikoJudgement> { Name = "Judgements", RelativeSizeAxes = Axes.Y, Margin = new MarginPadding { Left = HIT_TARGET_OFFSET }, Blending = BlendingMode.Additive }, } }, overlayBackgroundContainer = new Container { Name = "Left overlay", RelativeSizeAxes = Axes.Y, Size = new Vector2(left_area_size, 1), Children = new Drawable[] { overlayBackground = new Box { RelativeSizeAxes = Axes.Both, }, new InputDrum(controlPoints) { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Scale = new Vector2(0.9f), Margin = new MarginPadding { Right = 20 } }, new Box { Anchor = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = 10, Colour = Framework.Graphics.Colour.ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.6f), Color4.Black.Opacity(0)), }, } }, new Container { Name = "Border", RelativeSizeAxes = Axes.Both, Masking = true, MaskingSmoothness = 0, BorderThickness = 2, AlwaysPresent = true, Children = new[] { new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true } } }, topLevelHitContainer = new Container { Name = "Top level hit objects", RelativeSizeAxes = Axes.Both, } }); VisibleTimeRange.Value = 6000; }
private void load(OsuColour colours) { InternalChildren = new[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()), rightArea = new Container { Name = "Right area", RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, Children = new Drawable[] { new Container { Name = "Masked elements before hit objects", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Children = new[] { hitExplosionContainer = new Container <HitExplosion> { RelativeSizeAxes = Axes.Both, }, HitTarget = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.HitTarget), _ => new TaikoHitTarget()) { RelativeSizeAxes = Axes.Both, } } }, hitTargetOffsetContent = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { barLinePlayfield = new BarLinePlayfield(), new Container { Name = "Hit objects", RelativeSizeAxes = Axes.Both, Children = new Drawable[] { HitObjectContainer, drumRollHitContainer = new DrumRollHitContainer() } }, kiaiExplosionContainer = new Container <KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, }, judgementContainer = new JudgementContainer <DrawableTaikoJudgement> { Name = "Judgements", RelativeSizeAxes = Axes.Y, }, } }, } }, leftArea = new Container { Name = "Left overlay", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, BorderColour = colours.Gray0, Children = new Drawable[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundLeft), _ => new PlayfieldBackgroundLeft()), new InputDrum(HitObjectContainer) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, mascot = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Mascot), _ => Empty()) { Origin = Anchor.BottomLeft, Anchor = Anchor.TopLeft, RelativePositionAxes = Axes.Y, RelativeSizeAxes = Axes.None, Y = 0.2f }, topLevelHitContainer = new ProxyContainer { Name = "Top level hit objects", RelativeSizeAxes = Axes.Both, }, drumRollHitContainer.CreateProxy(), }; RegisterPool <Hit, DrawableHit>(50); RegisterPool <Hit.StrongNestedHit, DrawableHit.StrongNestedHit>(50); RegisterPool <DrumRoll, DrawableDrumRoll>(5); RegisterPool <DrumRoll.StrongNestedHit, DrawableDrumRoll.StrongNestedHit>(5); RegisterPool <DrumRollTick, DrawableDrumRollTick>(100); RegisterPool <DrumRollTick.StrongNestedHit, DrawableDrumRollTick.StrongNestedHit>(100); RegisterPool <Swell, DrawableSwell>(5); RegisterPool <SwellTick, DrawableSwellTick>(100); var hitWindows = new TaikoHitWindows(); foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => hitWindows.IsHitResultAllowed(r))) { judgementPools.Add(result, new DrawablePool <DrawableTaikoJudgement>(15)); explosionPools.Add(result, new HitExplosionPool(result)); } AddRangeInternal(judgementPools.Values); AddRangeInternal(explosionPools.Values); }
private void load(OsuColour colours) { InternalChildren = new[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()), rightArea = new Container { Name = "Right area", RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, Children = new Drawable[] { new Container { Name = "Masked elements before hit objects", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Children = new[] { hitExplosionContainer = new Container <HitExplosion> { RelativeSizeAxes = Axes.Both, }, HitTarget = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.HitTarget), _ => new TaikoHitTarget()) { RelativeSizeAxes = Axes.Both, } } }, hitTargetOffsetContent = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { barLinePlayfield = new BarLinePlayfield(), new Container { Name = "Hit objects", RelativeSizeAxes = Axes.Both, Children = new Drawable[] { HitObjectContainer, drumRollHitContainer = new DrumRollHitContainer() } }, kiaiExplosionContainer = new Container <KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, }, judgementContainer = new JudgementContainer <DrawableTaikoJudgement> { Name = "Judgements", RelativeSizeAxes = Axes.Y, }, } }, } }, leftArea = new Container { Name = "Left overlay", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, BorderColour = colours.Gray0, Children = new Drawable[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundLeft), _ => new PlayfieldBackgroundLeft()), new InputDrum(controlPoints) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, mascot = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Mascot), _ => Empty()) { Origin = Anchor.BottomLeft, Anchor = Anchor.TopLeft, RelativePositionAxes = Axes.Y, RelativeSizeAxes = Axes.None, Y = 0.2f }, topLevelHitContainer = new ProxyContainer { Name = "Top level hit objects", RelativeSizeAxes = Axes.Both, }, drumRollHitContainer.CreateProxy(), }; RegisterPool <Hit, DrawableHit>(50); RegisterPool <Hit.StrongNestedHit, DrawableHit.StrongNestedHit>(50); RegisterPool <DrumRoll, DrawableDrumRoll>(5); RegisterPool <DrumRoll.StrongNestedHit, DrawableDrumRoll.StrongNestedHit>(5); RegisterPool <DrumRollTick, DrawableDrumRollTick>(100); RegisterPool <DrumRollTick.StrongNestedHit, DrawableDrumRollTick.StrongNestedHit>(100); RegisterPool <Swell, DrawableSwell>(5); RegisterPool <SwellTick, DrawableSwellTick>(100); }
private void load(OsuColour colours) { InternalChildren = new Drawable[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()), rightArea = new Container { Name = "Right area", RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, Children = new Drawable[] { new Container { Name = "Masked elements before hit objects", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Children = new[] { hitExplosionContainer = new Container<HitExplosion> { RelativeSizeAxes = Axes.Both, Blending = BlendingParameters.Additive, }, HitTarget = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.HitTarget), _ => new TaikoHitTarget()) { RelativeSizeAxes = Axes.Both, } } }, hitTargetOffsetContent = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { barlineContainer = new ProxyContainer { RelativeSizeAxes = Axes.Both, }, new Container { Name = "Hit objects", RelativeSizeAxes = Axes.Both, Child = HitObjectContainer }, kiaiExplosionContainer = new Container<KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Blending = BlendingParameters.Additive }, judgementContainer = new JudgementContainer<DrawableTaikoJudgement> { Name = "Judgements", RelativeSizeAxes = Axes.Y, Blending = BlendingParameters.Additive }, } }, } }, leftArea = new Container { Name = "Left overlay", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, BorderColour = colours.Gray0, Children = new Drawable[] { new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundLeft), _ => new PlayfieldBackgroundLeft()), new InputDrum(controlPoints) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, topLevelHitContainer = new ProxyContainer { Name = "Top level hit objects", RelativeSizeAxes = Axes.Both, } }; }
public NotePlayfield(int columns) : base(columns) { if (InternalChildren.FirstOrDefault() is Container container) { // add padding to first children. container.Padding = new MarginPadding { Top = 30, Bottom = 30 }; } BackgroundLayer.AddRange(new Drawable[] { new SkinnableDrawable(new KaraokeSkinComponent(KaraokeSkinComponents.StageBackground), _ => null) { Depth = 2, RelativeSizeAxes = Axes.Both }, new Box { Depth = 1, Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f }, centerLine = new CenterLine { Anchor = Anchor.Centre, Origin = Anchor.Centre, } }); HitObjectLayer.Add(judgementArea = new Container { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, Children = new[] { judgements = new JudgementContainer <DrawableNoteJudgement> { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, BypassAutoSizeAxes = Axes.Both }, judgementLine = new SkinnableDrawable(new KaraokeSkinComponent(KaraokeSkinComponents.JudgementLine), _ => new DefaultJudgementLine()) { RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, saitenMarker = new SaitenMarker { Alpha = 0 } } }); HitObjectArea.AddRange(new Drawable[] { // todo : generate this only if in auto-play mode. replaySaitenVisualization = new ReplaySaitenVisualization(null) { Name = "Saiten Visualization", RelativeSizeAxes = Axes.Both, Alpha = 0.6f }, realTimeSaitenVisualization = new RealTimeSaitenVisualization { Name = "Saiten Visualization", RelativeSizeAxes = Axes.Both, }, }); AddInternal(saitenStatus = new SaitenStatus(SaitenStatusMode.NotInitialized)); }
public TauPlayfield() { cursor = new TauCursor(); AddRangeInternal(new Drawable[] { judgementLayer = new JudgementContainer <DrawableTauJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, }, new VisualisationContainer(), playfieldBackground = new Circle { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, Size = new Vector2(UNIVERSAL_SCALE), FillAspectRatio = 1, FillMode = FillMode.Fit, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, new Container { RelativeSizeAxes = Axes.Both, Size = new Vector2(UNIVERSAL_SCALE), Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new CircularContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, FillMode = FillMode.Fit, FillAspectRatio = 1, // 1:1 Aspect ratio to get a perfect circle BorderThickness = 3, BorderColour = Color4.White, Child = new Box { RelativeSizeAxes = Axes.Both, AlwaysPresent = true, Alpha = 0, } }, } }, new Container { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, FillAspectRatio = 1, Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(UNIVERSAL_SCALE), Children = new Drawable[] { HitObjectContainer, } }, cursor, kiaiExplosionContainer = new Container <KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Blending = BlendingParameters.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, }, }); }
public CrossStage(int firstColumnIndex, StageDefinition definition, ref CrossAction normalColumnStartAction, ref CrossAction specialColumnStartAction) { this.firstColumnIndex = firstColumnIndex; Name = "Stage"; Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { new Container { Name = "Columns mask", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Masking = true, CornerRadius = 5, Children = new Drawable[] { new Box { Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, columnFlow = new Container <Column> { Name = "Columns", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Padding = new MarginPadding { Left = COLUMN_SPACING, Right = COLUMN_SPACING }, }, } }, judgements = new JudgementContainer <DrawableCrossJudgement> { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Y = HIT_TARGET_POSITION + 150, BypassAutoSizeAxes = Axes.Both }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } }; for (int i = 0; i < definition.Columns; i++) { var isSpecial = definition.IsSpecialColumn(i); var column = new Column(firstColumnIndex + i) { IsSpecial = isSpecial, Action = { Value = isSpecial ? specialColumnStartAction++ : normalColumnStartAction++ } }; AddColumn(column); } }
public Stage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) { this.firstColumnIndex = firstColumnIndex; Name = "Stage"; Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; Container topLevelContainer; InternalChildren = new Drawable[] { judgementPool = new DrawablePool <DrawableManiaJudgement>(2), new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageBackground, stageDefinition: definition), _ => new DefaultStageBackground()) { RelativeSizeAxes = Axes.Both }, columnFlow = new ColumnFlow <Column>(definition) { RelativeSizeAxes = Axes.Y, }, new Container { Name = "Barlines mask", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Width = 1366, // Bar lines should only be masked on the vertical axis BypassAutoSizeAxes = Axes.Both, Masking = true, Child = barLineContainer = new HitObjectArea(HitObjectContainer) { Name = "Bar lines", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, } }, new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageForeground, stageDefinition: definition), _ => null) { RelativeSizeAxes = Axes.Both }, judgements = new JudgementContainer <DrawableManiaJudgement> { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Y = HIT_TARGET_POSITION + 150 }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } }; for (int i = 0; i < definition.Columns; i++) { var columnType = definition.GetTypeOfColumn(i); var column = new Column(firstColumnIndex + i) { RelativeSizeAxes = Axes.Both, Width = 1, ColumnType = columnType, AccentColour = columnColours[columnType], Action = { Value = columnType == ColumnType.Special ? specialColumnStartAction++ : normalColumnStartAction++ } }; topLevelContainer.Add(column.TopLevelContainer.CreateProxy()); columnFlow.SetContentForColumn(i, column); AddNested(column); } }
public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) { this.firstColumnIndex = firstColumnIndex; Name = "Stage"; Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { new Container { Name = "Columns mask", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Masking = true, CornerRadius = 5, Children = new Drawable[] { new Box { Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, columnFlow = new FillFlowContainer <Column> { Name = "Columns", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Left = COLUMN_SPACING, Right = COLUMN_SPACING }, Spacing = new Vector2(COLUMN_SPACING, 0) }, } }, new Container { Name = "Barlines mask", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Width = 1366, // Bar lines should only be masked on the vertical axis BypassAutoSizeAxes = Axes.Both, Masking = true, Child = barLineContainer = new Container { Name = "Bar lines", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, Child = HitObjectContainer } }, judgements = new JudgementContainer <DrawableManiaJudgement> { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Y = HIT_TARGET_POSITION + 150, }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } }; for (int i = 0; i < definition.Columns; i++) { var isSpecial = definition.IsSpecialColumn(i); var column = new Column(firstColumnIndex + i) { IsSpecial = isSpecial, Action = { Value = isSpecial ? specialColumnStartAction++ : normalColumnStartAction++ } }; AddColumn(column); } Direction.BindValueChanged(dir => { barLineContainer.Padding = new MarginPadding { Top = dir.NewValue == ScrollingDirection.Up ? HIT_TARGET_POSITION : 0, Bottom = dir.NewValue == ScrollingDirection.Down ? HIT_TARGET_POSITION : 0, }; }, true); }
public TauPlayfield(BeatmapDifficulty difficulty) { RelativeSizeAxes = Axes.None; cursor = new TauCursor(difficulty); Anchor = Anchor.Centre; Origin = Anchor.Centre; Size = new Vector2(768); AddRangeInternal(new Drawable[] { judgementLayer = new JudgementContainer <DrawableTauJudgement> { RelativeSizeAxes = Axes.Both, Depth = 1, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, new VisualisationContainer(), playfieldBackground = new Circle { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, new Container { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new CircularContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, BorderThickness = 3, BorderColour = Color4.White, Child = new Box { RelativeSizeAxes = Axes.Both, AlwaysPresent = true, Alpha = 0, } }, } }, HitObjectContainer, cursor, kiaiExplosionContainer = new Container <KiaiHitExplosion> { Name = "Kiai hit explosions", RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Blending = BlendingParameters.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, }, }); }
public NotePlayfield(int columns) { Columns = columns; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; InternalChildren = new Drawable[] { new Container { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Top = 30, Bottom = 30 }, Masking = true, CornerRadius = 5, Children = new Drawable[] { new Container { Name = "Background mask", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Masking = true, CornerRadius = 5, Children = new Drawable[] { new SkinnableDrawable(new KaraokeSkinComponent(KaraokeSkinComponents.StageBackground), _ => null) { RelativeSizeAxes = Axes.Both }, new Box { Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f }, columnFlow = new FillFlowContainer <DefaultColumnBackground> { Name = "Columns", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Padding = new MarginPadding { Top = COLUMN_SPACING, Bottom = COLUMN_SPACING }, Spacing = new Vector2(0, COLUMN_SPACING) }, centerLine = new CenterLine { Anchor = Anchor.Centre, Origin = Anchor.Centre, } } }, new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { judgementArea = new Container { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, Children = new[] { judgements = new JudgementContainer <DrawableNoteJudgement> { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, BypassAutoSizeAxes = Axes.Both }, judgementLine = new SkinnableDrawable(new KaraokeSkinComponent(KaraokeSkinComponents.JudgementLine), _ => new DefaultJudgementLine()) { RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, Origin = Anchor.Centre, }, saitenMarker = new SaitenMarker { Alpha = 0 } } }, hitObjectArea = new Container { Depth = 1, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, Children = new Drawable[] { hitObjectsContainer = new Container { Name = "Hit objects", RelativeSizeAxes = Axes.Both, Child = HitObjectContainer }, replaySaitenVisualization = new SaitenVisualization { Name = "Saiten Visualization", RelativeSizeAxes = Axes.Both, PathRadius = 1.5f, Alpha = 0.6f }, realTimeSaitenVisualization = new RealTimeSaitenVisualization { Name = "Saiten Visualization", RelativeSizeAxes = Axes.Both, Masking = true, PathRadius = 2.5f, OrientatePosition = SaitenVisualization.SaitenOrientatePosition.End }, } } }, } } } }; for (int i = 0; i < columns; i++) { var column = new DefaultColumnBackground(i) { IsSpecial = i % 2 == 0 }; AddColumn(column); } Direction.BindValueChanged(dir => { bool left = dir.NewValue == ScrollingDirection.Left; //TODO : will apply in skin var judgementAreaPercentage = 0.4f; var judgementPadding = 10; judgementArea.Size = new Vector2(judgementAreaPercentage, 1); judgementArea.X = left ? 0 : 1 - judgementAreaPercentage; judgementLine.Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft; saitenMarker.Anchor = saitenMarker.Origin = left ? Anchor.CentreRight : Anchor.CentreLeft; saitenMarker.Scale = left ? new Vector2(1, 1) : new Vector2(-1, 1); judgements.Anchor = judgements.Origin = left ? Anchor.CentreRight : Anchor.CentreLeft; judgements.X = left ? -judgementPadding : judgementPadding; hitObjectArea.Size = new Vector2(1 - judgementAreaPercentage, 1); hitObjectArea.X = left ? judgementAreaPercentage : 0; realTimeSaitenVisualization.Anchor = left ? Anchor.CentreLeft : Anchor.CentreRight; realTimeSaitenVisualization.Origin = left ? Anchor.CentreRight : Anchor.CentreLeft; }, true); }
public RushPlayfield() { InternalChildren = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Distributed), // Top empty area new Dimension(GridSizeMode.Absolute, DEFAULT_HEIGHT), // Playfield area new Dimension(GridSizeMode.Distributed), // Ground area, extends to overall height }, Content = new[] { new[] { Empty() }, new Drawable[] { new Container { Name = "Playfield area", RelativeSizeAxes = Axes.Both, Children = new[] { new Container { Name = "Left area", Width = HIT_TARGET_OFFSET, RelativeSizeAxes = Axes.Y, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Depth = -1, Child = new Container { Name = "Left Play Zone", RelativeSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new Drawable[] { PlayerSprite = new RushPlayerSprite(DEFAULT_HEIGHT, 0) { Origin = Anchor.Centre, Position = new Vector2(PLAYER_OFFSET, DEFAULT_HEIGHT), Scale = new Vector2(0.75f), }, overPlayerEffectsContainer = new Container { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, } } }, }, new Container { Name = "Right area", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new Drawable[] { new Container { Name = "Hit target indicators", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Children = new Drawable[] { new HitTarget { Anchor = Anchor.TopLeft, Origin = Anchor.Centre, Size = new Vector2(HIT_TARGET_SIZE), FillMode = FillMode.Fit }, new HitTarget { Anchor = Anchor.BottomLeft, Origin = Anchor.Centre, Size = new Vector2(HIT_TARGET_SIZE), FillMode = FillMode.Fit }, } }, underEffectContainer = new Container { Name = "Under Effects", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET } }, judgementContainer = new JudgementContainer <DrawableRushJudgement> { Name = "Judgement", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET } }, new Container { Name = "Hit Objects", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Child = HitObjectContainer }, proxiedHitObjects = new ProxyContainer { Name = "Proxied Hit Objects", RelativeSizeAxes = Axes.Both, }, overEffectContainer = new Container { Name = "Over Effects", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET } }, halfPaddingOverEffectContainer = new Container { Name = "Over Effects (Half Padding)", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET / 2f } } } } } }, }, new Drawable[] { new Container { Name = "Ground area", RelativeSizeAxes = Axes.Both, // Due to the size of the player sprite, we have to push the ground even more to the bottom. Padding = new MarginPadding { Top = 50f }, Depth = float.MaxValue, Child = new GroundDisplay(), } } } } }; }