mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Restructure playfield so that various elements are masked.
This commit is contained in:
parent
27eef9122a
commit
61348ff08d
@ -44,10 +44,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
private readonly Container hitObjectContainer;
|
private readonly Container hitObjectContainer;
|
||||||
private readonly Container topLevelHitContainer;
|
private readonly Container topLevelHitContainer;
|
||||||
private readonly Container leftBackgroundContainer;
|
|
||||||
private readonly Container rightBackgroundContainer;
|
private readonly Container overlayBackgroundContainer;
|
||||||
private readonly Box leftBackground;
|
private readonly Container backgroundContainer;
|
||||||
private readonly Box rightBackground;
|
|
||||||
|
private readonly Box overlayBackground;
|
||||||
|
private readonly Box background;
|
||||||
|
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
@ -59,7 +61,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
Height = DEFAULT_PLAYFIELD_HEIGHT,
|
Height = DEFAULT_PLAYFIELD_HEIGHT,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
rightBackgroundContainer = new Container
|
backgroundContainer = new Container
|
||||||
{
|
{
|
||||||
Name = "Transparent playfield background",
|
Name = "Transparent playfield background",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -73,7 +75,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
rightBackground = new Box
|
background = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.6f
|
Alpha = 0.6f
|
||||||
@ -82,16 +84,17 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Transparent playfield elements",
|
Name = "Right area",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Left = left_area_size },
|
Margin = new MarginPadding { Left = left_area_size },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Hit target container",
|
Name = "Masked elements",
|
||||||
X = hit_target_offset,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = hit_target_offset },
|
||||||
|
Masking = true,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
hitExplosionContainer = new Container<HitExplosion>
|
hitExplosionContainer = new Container<HitExplosion>
|
||||||
@ -114,23 +117,25 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
judgementContainer = new Container<DrawableTaikoJudgement>
|
}
|
||||||
{
|
},
|
||||||
RelativeSizeAxes = Axes.Y,
|
judgementContainer = new Container<DrawableTaikoJudgement>
|
||||||
BlendingMode = BlendingMode.Additive
|
{
|
||||||
},
|
Name = "Judgements",
|
||||||
},
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Margin = new MarginPadding { Left = hit_target_offset },
|
||||||
|
BlendingMode = BlendingMode.Additive
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
leftBackgroundContainer = new Container
|
overlayBackgroundContainer = new Container
|
||||||
{
|
{
|
||||||
Name = "Left overlay",
|
Name = "Left overlay",
|
||||||
Size = new Vector2(left_area_size, DEFAULT_PLAYFIELD_HEIGHT),
|
Size = new Vector2(left_area_size, DEFAULT_PLAYFIELD_HEIGHT),
|
||||||
BorderThickness = 1,
|
BorderThickness = 1,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
leftBackground = new Box
|
overlayBackground = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
@ -164,11 +169,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
leftBackgroundContainer.BorderColour = colours.Gray0;
|
overlayBackgroundContainer.BorderColour = colours.Gray0;
|
||||||
leftBackground.Colour = colours.Gray1;
|
overlayBackground.Colour = colours.Gray1;
|
||||||
|
|
||||||
rightBackgroundContainer.BorderColour = colours.Gray1;
|
backgroundContainer.BorderColour = colours.Gray1;
|
||||||
rightBackground.Colour = colours.Gray0;
|
background.Colour = colours.Gray0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
|
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
|
||||||
|
Loading…
Reference in New Issue
Block a user