Esempio n. 1
0
            private void load()
            {
                AutoSizeAxes = Axes.Both;

                Children = new Drawable[]
                {
                    circle = new CircularProgress
                    {
                        Size        = new Vector2(playerMetadata?.Size * 2.1f ?? 30 * 2.1f),
                        InnerRadius = 0.2f,
                        Alpha       = 0.5f
                    },
                    circleBackdrop = new CircularProgress
                    {
                        Size        = new Vector2(playerMetadata?.Size * 2.1f ?? 30 * 2.1f),
                        InnerRadius = 0.2f,
                        Alpha       = 0.25f
                    },
                };

                health.Value = playerMetadata.Health;

                health.ValueChanged += value =>
                {
                    circle.FillTo(value.NewValue / playerMetadata.Health, 1000, Easing.OutExpo);
                };

                circle.Current.Value         = 1;
                circleBackdrop.Current.Value = 1;
            }
        private void transform(int tf)
        {
            setRotationMode(-1);

            switch (tf)
            {
            case 0:
                clock.FillTo(0).Then().FillTo(1, 1000).Loop();
                break;

            case 1:
                clock.FillTo(1).Then().FillTo(0, 1000).Loop();
                break;

            case 2:
                clock.FillTo(0, 1000).Then().FillTo(1, 1000).Loop();
                break;

            case 3:
                clock.FillTo(0).Then().FillTo(1, 1000, Easing.InOutQuart).Loop();
                break;
            }
        }