public override Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) { foreach (string name in getFallbackNames(componentName)) { // some component names (especially user-controlled ones, like `HitX` in mania) // may contain `@2x` scale specifications. // stable happens to check for that and strip them, so do the same to match stable behaviour. string lookupName = name.Replace(@"@2x", string.Empty); float ratio = 2; var texture = Textures?.Get(@$ "{lookupName}@2x", wrapModeS, wrapModeT); if (texture == null) { ratio = 1; texture = Textures?.Get(lookupName, wrapModeS, wrapModeT); } if (texture == null) { continue; } texture.ScaleAdjust = ratio; return(texture); } return(null); }
private void load(TextureStore textures) { Children = new Drawable[] { buttonSprite = new Sprite { Texture = textures.Get(@"KeyCounter/key-up"), Anchor = Anchor.Centre, Origin = Anchor.Centre, }, glowSprite = new Sprite { Texture = textures.Get(@"KeyCounter/key-glow"), Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0 }, textLayer = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new SpriteText { Text = Name, Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativePositionAxes = Axes.Both, Position = new Vector2(0, -0.25f), Colour = KeyUpTextColor }, countSpriteText = new SpriteText { Text = Count.ToString(@"#,0"), Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativePositionAxes = Axes.Both, Position = new Vector2(0, 0.25f), Colour = KeyUpTextColor } } } }; //Set this manually because an element with Alpha=0 won't take it size to AutoSizeContainer, //so the size can be changing between buttonSprite and glowSprite. Height = buttonSprite.DrawHeight; Width = buttonSprite.DrawWidth; }
private void load(TextureStore textures) { Texture = textures.Get(@"Menu/logo"); Transforms.Add(new TransformPositionY() { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f }); Transforms.Add(new TransformAlpha() { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 }); Expire(true); }
private void load(TextureStore textures) { Texture = textures.Get(@"Menu/logo"); Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); Expire(true); }
private void load(TextureStore textures) { Children = new Drawable[] { new Sprite { Texture = textures.Get(@"Cursor/cursor") } }; }
public override Texture GetTexture(string componentName) { componentName = getFallbackName(componentName); float ratio = 2; var texture = Textures?.Get($"{componentName}@2x"); if (texture == null) { ratio = 1; texture = Textures?.Get(componentName); } if (texture != null) { texture.ScaleAdjust = ratio; } return(texture); }
private void load(TextureStore textures) { Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); Add(new Sprite { Texture = textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), RelativePositionAxes = Axes.Both, Position = new Vector2(0.1f, 0.5f), Colour = Color4.Gray }); }
public override Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) { foreach (string name in getFallbackNames(componentName)) { float ratio = 2; var texture = Textures?.Get($"{name}@2x", wrapModeS, wrapModeT); if (texture == null) { ratio = 1; texture = Textures?.Get(name, wrapModeS, wrapModeT); } if (texture == null) { continue; } texture.ScaleAdjust = ratio; return(texture); } return(null); }
private void load(TextureStore textures) { Size = new Vector2(PippidonPlayfield.LANE_HEIGHT); Child = new Sprite { FillMode = FillMode.Fit, Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.2f), RelativeSizeAxes = Axes.Both, Texture = textures.Get("character") }; LanePosition.BindValueChanged(e => { this.MoveToY(e.NewValue * PippidonPlayfield.LANE_HEIGHT); }); }
protected override bool BackgroundStillValid(Texture b) => false; // bypass lazy logic. we want to return a new background each time for refcounting purposes. protected override Texture GetBackground() { if (Metadata?.BackgroundFile == null) { return(null); } try { return(textureStore.Get(getPathForFile(Metadata.BackgroundFile))); } catch { return(null); } }
public override Drawable GetDrawableComponent(string componentName) { var texture = textures.Get(getPathForFile(componentName.Split('/').Last())); if (texture == null) { return(null); } return(new Sprite { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, Texture = texture, }); }
private void load(DrawableHitObject drawableObject, TextureStore textures) { accentColour.BindTo(drawableObject.AccentColour); accentColour.BindValueChanged(colour => Colour = colour.NewValue, true); AddInternal(new Sprite() { RelativeSizeAxes = Axes.Both, Rotation = -45, Anchor = Anchor.Centre, Origin = Anchor.BottomLeft, Texture = textures.Get("HitObjectLine") }); drawableObject.ApplyCustomUpdateState += updateState; }
private void load(TextureStore textures, DrawableHitObject drawableObject) { disc.Texture = textures.Get(@"Gameplay/osu/disc"); state.BindTo(drawableObject.State); state.BindValueChanged(updateState, true); accentColour.BindTo(drawableObject.AccentColour); accentColour.BindValueChanged(colour => { explode.Colour = colour.NewValue; Glow.Colour = colour.NewValue; Progress.Colour = colour.NewValue; fillCircle.Colour = colour.NewValue; }, true); }
private void load(TextureStore textures, IAPIProvider api) { Origin = Anchor.Centre; Anchor = Anchor.Centre; Children = new Drawable[] { scaleContainer = new Container { AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { LogoVisualisation = new LogoVisualisation { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.DarkBlue, Size = new Vector2(0.96f) }, new Circle { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(480), Colour = Color4.Black }, } }, }; if (api.LocalUser.Value.IsSupporter) { scaleContainer.Add(welcomeText = new SkinnableSprite(@"Intro/Welcome/welcome_text")); } else { scaleContainer.Add(welcomeText = new Sprite { Texture = textures.Get(@"Intro/Welcome/welcome_text") }); } welcomeText.Anchor = Anchor.Centre; welcomeText.Origin = Anchor.Centre; }
protected override bool BackgroundStillValid(Texture b) => false; // bypass lazy logic. we want to return a new background each time for refcounting purposes. protected override Texture GetBackground() { if (Metadata?.BackgroundFile == null) { return(null); } try { return(textureStore.Get(getPathForFile(Metadata.BackgroundFile))); } catch (Exception e) { Logger.Error(e, "Background failed to load"); return(null); } }
private void Load(TextureStore store) { var ballTex = store.Get("sliderb"); Origin = Anchor.Centre; Blending = BlendingParameters.Additive; AddInternal(_ball = new Sprite { Texture = ballTex, Anchor = Anchor.Centre, Origin = Anchor.Centre, }); Size = _ball.Size; }
private void load(TextureStore textures) { Texture texture = null; if (!string.IsNullOrEmpty(url)) { texture = textures.Get(url); } // Use a default texture if (texture == null) { texture = GetNotFoundTexture(textures); } image.Texture = texture; }
private void load(TextureStore textures) { FillFlowContainer row; InternalChildren = new Drawable[] { row = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), }, }; if (!string.IsNullOrEmpty(mods)) { row.Add(new Sprite { Texture = textures.Get($"Mods/{mods.ToLower()}"), Scale = new Vector2(0.5f) }); } row.Add(new Container { Size = new Vector2(50, 16), CornerRadius = 10, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = TournamentGame.ELEMENT_BACKGROUND_COLOUR, }, new TournamentSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = seeding.ToString("#,0"), Colour = TournamentGame.ELEMENT_FOREGROUND_COLOUR }, } }); }
private void load(TextureStore textures) { InternalChildren = new Drawable[] { new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get(@"Gameplay/osu/disc"), }, new TrianglesPiece { RelativeSizeAxes = Axes.Both, Blending = BlendingParameters.Additive, Alpha = 0.5f, } }; }
private void load(IBindable <WorkingBeatmap> beatmap, TextureStore textureStore) { for (var frame = 0; frame < Animation.FrameCount; frame++) { var framePath = Animation.Path.Replace(".", frame + "."); var path = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.Equals(framePath, StringComparison.InvariantCultureIgnoreCase))?.FileInfo.StoragePath; if (path == null) { continue; } var texture = textureStore.Get(path); AddFrame(texture, Animation.FrameDelay); } Animation.ApplyTransforms(this); }
private void load(OverlayColourProvider colourProvider, TextureStore textures) { Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour = colourProvider.Background3, }, new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Absolute, 50), new Dimension(), }, Content = new[] { new Drawable[] { new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get("Icons/Hexacons/messaging"), Size = new Vector2(18), }, // Placeholder text new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = ChatStrings.TitleCompact, Font = OsuFont.Torus.With(size: 16, weight: FontWeight.SemiBold), Margin = new MarginPadding { Bottom = 2f }, }, }, }, }, }; }
private void load(OsuColour colours, TextureStore textures, AudioManager audio) { getSample = audio.Sample.Get(@"MedalSplash/medal-get"); innerSpin.Texture = outerSpin.Texture = textures.Get(@"MedalSplash/disc-spin"); disc.EdgeEffect = leftStrip.EdgeEffect = rightStrip.EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = colours.Blue.Opacity(0.5f), Radius = 50, }; disc.Add(drawableMedal = new DrawableMedal(medal) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Both, }); }
private void load(OsuGameBase game, TextureStore textureStore) { var basePath = Animation.Path.ToLowerInvariant(); for (var frame = 0; frame < Animation.FrameCount; frame++) { var framePath = basePath.Replace(".", frame + "."); var path = game.Beatmap.Value.BeatmapSetInfo.Files.FirstOrDefault(f => f.Filename.ToLowerInvariant() == framePath)?.FileInfo.StoragePath; if (path == null) { continue; } var texture = textureStore.Get(path); AddFrame(texture, Animation.FrameDelay); } Animation.ApplyTransforms(this); }
private void load(TextureStore textures) { AddStep("create initial", () => { Child = explosion = new ParticleExplosion(textures.Get("Cursor/cursortrail"), 150, 1200) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(400) }; }); AddWaitStep("wait for playback", 5); AddRepeatStep(@"restart animation", () => { explosion.Restart(); }, 10); }
public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore) { Drawable drawable = null; string storyboardPath = BeatmapInfo.BeatmapSet?.Files.Find(f => f.Filename.Equals(path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; if (!string.IsNullOrEmpty(storyboardPath)) { drawable = new Sprite { Texture = textureStore.Get(storyboardPath) } } ; // if the texture isn't available locally in the beatmap, some storyboards choose to source from the underlying skin lookup hierarchy. else if (UseSkinSprites) { drawable = new SkinnableSprite(path); } return(drawable); }
private void load(OsuColour colours, TextureStore textures) { InternalChildren = new Drawable[] { new Sprite { RelativeSizeAxes = Axes.Both, Texture = textures.Get("Profile/levelbadge"), Colour = colours.Yellow, }, levelText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(size: 20) } }; User.BindValueChanged(user => updateLevel(user.NewValue)); }
private void Load(TextureStore store) { Children = new Drawable[] { new Container { AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { sprite = new Sprite { Texture = store.Get(getFromStore), Anchor = Anchor.Centre, Origin = Anchor.Centre, }, } } }; }
private void load(TextureStore textures) { RelativeSizeAxes = Axes.Both; AddRangeInternal(new Drawable[] { particles = new Container <DeathParticle> { RelativeSizeAxes = Axes.Both }, circle = new Sprite { Size = new Vector2(DrawableTile.SIZE * 5), Origin = Anchor.Centre, Scale = Vector2.Zero, Alpha = 0, AlwaysPresent = true, Texture = textures.Get("death-circle") }, }); }
private void updateTexture() { string textureName; switch (Rank) { default: textureName = Rank.GetDescription(); break; case ScoreRank.SH: textureName = "SPlus"; break; case ScoreRank.XH: textureName = "SSPlus"; break; } rankSprite.Texture = textures.Get($@"Grades/{textureName}"); }
private void load(TextureStore textures) { InternalChildren = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), Children = new Drawable[] { new Sprite { Texture = textures.Get($"mods/{mods.ToLower()}"), Scale = new Vector2(0.5f) }, new Container { Size = new Vector2(50, 16), CornerRadius = 10, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = TournamentGame.TEXT_COLOUR, }, new TournamentSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = seeding.ToString("#,0"), }, } }, } }, }; }
private void load(TextureStore textures) { Origin = Anchor.Centre; Anchor = Anchor.Centre; Children = new Drawable[] { scaleContainer = new Container { AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { LogoVisualisation = new LogoVisualisation { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0.5f, AccentColour = Color4.DarkBlue, Size = new Vector2(0.96f) }, new Circle { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(480), Colour = Color4.Black }, welcomeText = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get(@"Intro/Welcome/welcome_text") }, } }, }; }
private void load(AudioManager audio, TextureStore textures) { RelativeSizeAxes = Axes.Both; Masking = true; AddRangeInternal(new Drawable[] { tint = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Red, Alpha = 0 }, blackFlash = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0 }, sprite = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(0.8f), FillMode = FillMode.Fit, Texture = textures.Get("game-over"), Alpha = 0, }, continueLayer = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, Colour = Color4.Black }, letterbox = new LetterboxOverlay(), deathSample = new DrawableSample(audio.Samples.Get("death")), }); }
public RulesetIcon(TextureStore store) { AutoSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = FontAwesome.Regular.Circle, Size = new Vector2(60), Colour = Color4.White }, new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = store.Get("Textures/logo_pixelated.png"), FillMode = FillMode.Fit, Size = new Vector2(40) } }; }
private void load(TextureStore textures, FontStore store, GameHost host) { if (!textures.GetAvailableResources().Contains("Textures/tau.png")) { textures.AddStore(host.CreateTextureLoaderStore(ruleset.CreateResourceStore())); } // Note to new ruleset creators: // This is definitely something you should try to avoid. // Typically resources would only be loaded inside of gameplay, NOT anywhere else. // Until the osu! team figures out a safe way for you to use resources out of the gameplay area (e.g mods icon), // Please try to avoid this at all costs. store.AddStore(new GlyphStore( new ResourceStore <byte[]>(ruleset.CreateResourceStore()), "Fonts/tauFont", host.CreateTextureLoaderStore(ruleset.CreateResourceStore()))); AddRangeInternal(new Drawable[] { new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = FontAwesome.Regular.Circle, }, new Sprite { RelativeSizeAxes = Axes.Both, Size = new Vector2(1), Scale = new Vector2(.625f), Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get("Textures/tau") } }); }
private void load(TextureStore textures) { ring.Texture = textures.Get(@"Play/osu/ring@2x"); }
private void load(TextureStore textures) { number.Texture = textures.Get(@"Play/osu/number@2x"); }
private void load(TextureStore textures) { Texture = textures.Get(url); }
private void load(TextureStore textures) { if (!string.IsNullOrEmpty(textureName)) Sprite.Texture = textures.Get(textureName); }
private void load(ShaderManager shaders, TextureStore textures) { shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.Texture); texture = textures.Get(@"Cursor/cursortrail"); }
private void load(OsuGame game, TextureStore textures) { this.game = game; guestTexture = textures.Get(@"Online/avatar-guest@2x"); }
private void load(TextureStore textures) { logo.Texture = textures.Get(@"Menu/logo@2x"); ripple.Texture = textures.Get(@"Menu/logo@2x"); }
private void load(TextureStore textures) { layer.Texture = textures.Get(@"Play/osu/ring-glow@2x"); }
private void load(TextureStore textures) { sprite.Texture = beatmap?.Background ?? textures.Get(@"Backgrounds/bg4"); }
private void load(TextureStore textures) { approachCircle.Texture = textures.Get(@"Play/osu/approachcircle@2x"); }
private void load(TextureStore textures) { disc.Texture = textures.Get(@"Play/osu/disc@2x"); }