예제 #1
0
        public Column(ScrollingDirection direction)
            : base(direction)
        {
            RelativeSizeAxes = Axes.Y;
            Width            = column_width;

            Masking      = true;
            CornerRadius = 5;

            background = new ColumnBackground {
                RelativeSizeAxes = Axes.Both
            };

            Container hitTargetContainer;

            InternalChildren = new[]
            {
                // For input purposes, the background is added at the highest depth, but is then proxied back below all other elements
                background.CreateProxy(),
                    hitTargetContainer = new Container
                {
                    Name             = "Hit target + hit objects",
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        hitObjectArea = new ColumnHitObjectArea {
                            RelativeSizeAxes = Axes.Both
                        },
                        explosionContainer = new Container
                        {
                            Name             = "Hit explosions",
                            RelativeSizeAxes = Axes.Both
                        }
                    }
                },
                    keyArea = new ColumnKeyArea
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = ManiaStage.HIT_TARGET_POSITION,
                },
                    background,
                    TopLevelContainer = new Container {
                    RelativeSizeAxes = Axes.Both
                }
            };

            TopLevelContainer.Add(explosionContainer.CreateProxy());

            Direction.BindValueChanged(d =>
            {
                hitTargetContainer.Padding = new MarginPadding
                {
                    Top    = d == ScrollingDirection.Up ? ManiaStage.HIT_TARGET_POSITION : 0,
                    Bottom = d == ScrollingDirection.Down ? ManiaStage.HIT_TARGET_POSITION : 0,
                };

                keyArea.Anchor = keyArea.Origin = d == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
            }, true);
        }
예제 #2
0
        public Column(int index)
        {
            Index = index;

            RelativeSizeAxes = Axes.Y;
            Width            = COLUMN_WIDTH;

            background = new ColumnBackground {
                RelativeSizeAxes = Axes.Both
            };

            Container hitTargetContainer;

            InternalChildren = new[]
            {
                // For input purposes, the background is added at the highest depth, but is then proxied back below all other elements
                background.CreateProxy(),
                    hitTargetContainer = new Container
                {
                    Name             = "Hit target + hit objects",
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        hitObjectArea = new ColumnHitObjectArea(HitObjectContainer)
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        explosionContainer = new Container
                        {
                            Name             = "Hit explosions",
                            RelativeSizeAxes = Axes.Both,
                        }
                    }
                },
                    keyArea = new ColumnKeyArea
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = ManiaStage.HIT_TARGET_POSITION,
                },
                    background,
                    TopLevelContainer = new Container {
                    RelativeSizeAxes = Axes.Both
                }
            };

            TopLevelContainer.Add(explosionContainer.CreateProxy());

            Direction.BindValueChanged(dir =>
            {
                hitTargetContainer.Padding = new MarginPadding
                {
                    Top    = dir.NewValue == ScrollingDirection.Up ? ManiaStage.HIT_TARGET_POSITION : 0,
                    Bottom = dir.NewValue == ScrollingDirection.Down ? ManiaStage.HIT_TARGET_POSITION : 0,
                };

                explosionContainer.Padding = new MarginPadding
                {
                    Top    = dir.NewValue == ScrollingDirection.Up ? NotePiece.NOTE_HEIGHT / 2 : 0,
                    Bottom = dir.NewValue == ScrollingDirection.Down ? NotePiece.NOTE_HEIGHT / 2 : 0
                };

                keyArea.Anchor = keyArea.Origin = dir.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
            }, true);
        }
예제 #3
0
        public Column(int index)
        {
            Index = index;

            RelativeSizeAxes = Axes.Y;
            Width            = column_width;

            Masking      = true;
            CornerRadius = 5;

            background = new ColumnBackground {
                RelativeSizeAxes = Axes.Both
            };

            Container hitTargetContainer;

            InternalChildren = new Drawable[]
            {
                hitTargetContainer = new Container
                {
                    Name             = "Hit target + hit objects",
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        hitObjectArea = new ColumnHitObjectArea(HitObjectContainer)
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        explosionContainer = new Container
                        {
                            Name             = "Hit explosions",
                            RelativeSizeAxes = Axes.Both
                        }
                    }
                },
                keyArea = new ColumnKeyArea
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = CrossStage.HIT_TARGET_POSITION,
                },
                TopLevelContainer = new Container {
                    RelativeSizeAxes = Axes.Both
                }
            };

            TopLevelContainer.Add(explosionContainer.CreateProxy());

            this.Anchor = Anchor.Centre;

            switch (Index)
            {
            case 0:
                this.OriginPosition = new Vector2(22, -30);
                this.Rotation       = 90;
                break;

            case 1:
                this.OriginPosition = new Vector2(22, -30);
                this.Rotation       = 180;
                break;

            case 2:
                this.OriginPosition = new Vector2(22, -30);
                this.Rotation       = 0;
                break;

            case 3:
                this.OriginPosition = new Vector2(22, -30);
                this.Rotation       = -90;
                break;
            }
        }