Exemplo n.º 1
0
        private void Init()
        {
            var bg = CreateChild <UguiSprite>("bg");

            {
                bg.Anchor     = AnchorType.Fill;
                bg.SpriteName = "circle-320";
                bg.Color      = ColorPreset.DarkBackground;
                bg.Offset     = Offset.Zero;
            }
            meterSprite = CreateChild <UguiSprite>("meter");
            {
                meterSprite.Anchor     = AnchorType.Fill;
                meterSprite.Offset     = Offset.Zero;
                meterSprite.SpriteName = "circle-320";
                meterSprite.ImageType  = Image.Type.Filled;
                meterSprite.SetRadial360Fill(Image.Origin360.Top);

                meterGradient = meterSprite.AddEffect(new GradientEffect());
                meterGradient.Component.direction = UIGradient.Direction.Vertical;
                meterGradient.Component.color1    = Color.white;
                meterGradient.Component.color2    = HexColor.Create("A0A0A0");
                meterGradient.Component.offset    = 0.75f;
            }
            rangeDisplay = CreateChild <RankCircleRange>("ranges");
            {
                rangeDisplay.Anchor = AnchorType.Fill;
                rangeDisplay.Offset = new Offset(18f);
            }
            var mask = CreateChild <UguiSprite>("mask");

            {
                mask.Anchor     = AnchorType.Fill;
                mask.Offset     = new Offset(28f);
                mask.Color      = ColorPreset.DarkBackground;
                mask.SpriteName = "circle-320";
                mask.AddEffect(new MaskEffect());

                mapThumb = mask.CreateChild <MapImageDisplay>("thumb");
                {
                    mapThumb.Anchor = AnchorType.Fill;
                    mapThumb.Offset = Offset.Zero;
                    mapThumb.Color  = new Color(1f, 1f, 1f, 0.25f);
                }
            }
            rankGlowSprite = CreateChild <UguiSprite>("rank-glow");
            {
                rankGlowSprite.Size       = new Vector2(256f, 256f);
                rankGlowSprite.SpriteName = "glow-128";
                rankGlowSprite.Alpha      = 0.625f;
            }
            rankLabel = CreateChild <Label>("rank");
            {
                rankLabel.IsBold   = true;
                rankLabel.FontSize = 128;

                rankShadowEffect = rankLabel.AddEffect(new ShadowEffect());
                rankShadowEffect.Component.style = ShadowStyle.Outline8;
            }
            var accBg = CreateChild <UguiSprite>("acc-bg");

            {
                accBg.Position   = new Vector3(0f, -84f);
                accBg.Size       = new Vector2(280f, 64f);
                accBg.SpriteName = "glow-128";
                accBg.Color      = Color.black;
            }
            accuracyLabel = CreateChild <Label>("accuracy");
            {
                accuracyLabel.Position = accBg.Position;
                accuracyLabel.FontSize = 22;
            }

            OnEnableInited();
        }