示例#1
0
        public Drawable GetDrawableComponent(string componentName)
        {
            Drawable sourceDrawable;

            if (beatmapSkins && (sourceDrawable = source.GetDrawableComponent(componentName)) != null)
            {
                return(sourceDrawable);
            }
            return(fallbackSource?.GetDrawableComponent(componentName));
        }
示例#2
0
        private void load(DrawableHitObject drawableHitObject, ISkinSource source)
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            // osu!stable positions spinner components in window-space (as opposed to gamefield-space). This is a 640x480 area taking up the entire screen.
            // In lazer, the gamefield-space positional transformation is applied in OsuPlayfieldAdjustmentContainer, which is inverted here to make this area take up the entire window space.
            Size     = new Vector2(640, 480);
            Position = new Vector2(0, -8f);

            DrawableSpinner = (DrawableSpinner)drawableHitObject;

            Container overlayContainer;

            AddInternal(overlayContainer = new Container
            {
                Depth            = float.MinValue,
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    spin = new Sprite
                    {
                        Anchor  = Anchor.TopCentre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-spin"),
                        Scale   = new Vector2(SPRITE_SCALE),
                        Y       = SPINNER_TOP_OFFSET + 335,
                    },
                    clear = new Sprite
                    {
                        Alpha   = 0,
                        Anchor  = Anchor.TopCentre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-clear"),
                        Scale   = new Vector2(SPRITE_SCALE),
                        Y       = SPINNER_TOP_OFFSET + 115,
                    },
                }
            });

            bonusCounter = (source.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText)) as LegacySpriteText)?.With(c =>
            {
                c.Alpha  = 0f;
                c.Anchor = Anchor.TopCentre;
                c.Origin = Anchor.Centre;
                c.Font   = c.Font.With(fixedWidth: false);
                c.Scale  = new Vector2(SPRITE_SCALE);
                c.Y      = SPINNER_TOP_OFFSET + 299;
            });

            if (bonusCounter != null)
            {
                overlayContainer.Add(bonusCounter);
            }
        }
        public Drawable GetDrawableComponent(ISkinComponent component)
        {
            Drawable sourceDrawable;

            if (AllowDrawableLookup(component) && (sourceDrawable = skin?.GetDrawableComponent(component)) != null)
            {
                return(sourceDrawable);
            }

            return(fallbackSource?.GetDrawableComponent(component));
        }
示例#4
0
        public Drawable GetDrawableComponent(string componentName)
        {
            Drawable sourceDrawable;

            if (AllowDrawableLookup(componentName) && (sourceDrawable = skin?.GetDrawableComponent(componentName)) != null)
            {
                return(sourceDrawable);
            }

            return(fallbackSource?.GetDrawableComponent(componentName));
        }
示例#5
0
        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            Drawable = skin.GetDrawableComponent(componentName);

            isDefault = false;

            if (Drawable == null && allowFallback)
            {
                Drawable  = CreateDefault(componentName);
                isDefault = true;
            }

            if (Drawable != null)
            {
                scaling.Invalidate();
                Drawable.Origin = Anchor.Centre;
                Drawable.Anchor = Anchor.Centre;
                InternalChild   = Drawable;
            }
            else
            {
                ClearInternal();
            }
        }
 public Drawable GetDrawableComponent(ISkinComponent component) => skin.GetDrawableComponent(component);