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") } }; }
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 }); }
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; }
public CytusDrawableSliderEnd(CytusSliderTick hitObject, float x, float y, TextureStore textures) : base(hitObject, x, y, textures) { // Don't show the arrow, since we're the last one SliderArrow.Hide(); }
private void load(ShaderManager shaders, TextureStore textures) { shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE); texture = textures.Get(@"Cursor/cursortrail"); Scale = new Vector2(1 / texture.ScaleAdjust); }
private void load(TextureStore textures) { sprite.Texture = beatmap?.Background ?? textures.Get(@"Backgrounds/bg4"); }
public AgentFactory(Renderer renderer, ContentManager contentManager, JobFactory jobFactory) { this.contentManager = contentManager; this.jobFactory = jobFactory; textureStore = new TextureStore(renderer); }
private void load(TextureStore textures) { Texture = textures.Get(url); }
private void load(OverlayColourProvider colourProvider, TextureStore textures) { Container <Drawable> hiddenDetailContainer; Container <Drawable> expandedDetailContainer; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background4 }, new FillFlowContainer { AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Vertical = 10 }, Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Spacing = new Vector2(10, 0), Children = new Drawable[] { new FollowersButton { User = { BindTarget = User } }, new MappingSubscribersButton { User = { BindTarget = User } }, new MessageUserButton { User = { BindTarget = User } }, } }, new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, Padding = new MarginPadding { Vertical = 10 }, Width = UserProfileOverlay.CONTENT_X_MARGIN, Child = new ExpandDetailsButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, DetailsVisible = { BindTarget = DetailsVisible } }, }, new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Right = UserProfileOverlay.CONTENT_X_MARGIN }, Children = new Drawable[] { new LevelBadge { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Size = new Vector2(40), User = { BindTarget = User } }, expandedDetailContainer = new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Width = 200, Height = 6, Margin = new MarginPadding { Right = 50 }, Child = new LevelProgressBar { RelativeSizeAxes = Axes.Both, User = { BindTarget = User } } }, hiddenDetailContainer = new FillFlowContainer { Direction = FillDirection.Horizontal, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Width = 200, AutoSizeAxes = Axes.Y, Alpha = 0, Spacing = new Vector2(10, 0), Margin = new MarginPadding { Right = 50 }, Children = new[] { hiddenDetailGlobal = new OverlinedInfoContainer { Title = UsersStrings.ShowRankGlobalSimple, LineColour = colourProvider.Highlight1 }, hiddenDetailCountry = new OverlinedInfoContainer { Title = UsersStrings.ShowRankCountrySimple, LineColour = colourProvider.Highlight1 }, } } } } }; DetailsVisible.BindValueChanged(visible => { hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint); expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint); }); User.BindValueChanged(user => updateDisplay(user.NewValue)); }
private void load(TextureStore store) { chevron.Texture = store.Get("chevron-down"); }
private void load(TextureStore textures, ArborGame game, Story story) { InternalChildren = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Sprite { Depth = float.MaxValue, Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get("Backgrounds/grass"), Size = Vector2.One, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, }, new Button { Position = new Vector2(10, -160), Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = "Load Test World", CornerRadius = 8, Size = new Vector2(200, 100), Action = () => this.Push(new GameScreen()), BackgroundColour = Color4.Gray, }, settings = new SettingsOverlay { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, }, new Button { Position = new Vector2(10, 160), Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = "Toggle Settings", CornerRadius = 8, Size = new Vector2(200, 100), Action = settings.ToggleVisibility, BackgroundColour = Color4.Gray, }, new SpriteText { Colour = Color4.Wheat, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Font = FontUsage.Default.With(size: 60), Text = $"Welcome to the \"{story.Name}\" game!" }, } } }; if (game.StoryStorage != null) { AddInternal(new Button { Position = new Vector2(10, 0), Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = "Load Editor", CornerRadius = 8, Size = new Vector2(200, 100), Action = () => this.Push(new MapEditorScreen()), BackgroundColour = Color4.Gray, }); } }
private void load(TextureStore textures) { approachCircle.Texture = textures.Get(@"Play/osu/approachcircle@2x"); }
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, Storage storage, DependencyContainer dependencies) { this.storage = storage; TextureStore flagStore = new TextureStore(); // Local flag store flagStore.AddStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(new StorageBackedResourceStore(storage), "Drawings"))); // Default texture store flagStore.AddStore(textures); dependencies.Cache(flagStore); if (TeamList == null) { TeamList = new StorageBackedTeamList(storage); } if (!TeamList.Teams.Any()) { Exit(); return; } drawingsConfig = new DrawingsConfigManager(storage); Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(77, 77, 77, 255) }, new Sprite { FillMode = FillMode.Fill, Texture = textures.Get(@"Backgrounds/Drawings/background.png") }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { // Main container new Container { RelativeSizeAxes = Axes.Both, Width = 0.85f, Children = new Drawable[] { // Visualiser new VisualiserContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Size = new Vector2(1, 10), Colour = new Color4(255, 204, 34, 255), Lines = 6 }, // Groups groupsContainer = new GroupContainer(drawingsConfig.Get <int>(DrawingsConfig.Groups), drawingsConfig.Get <int>(DrawingsConfig.TeamsPerGroup)) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Padding = new MarginPadding { Top = 35f, Bottom = 35f } }, // Scrolling teams teamsContainer = new ScrollingTeamContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, }, // Scrolling team name fullTeamNameText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.TopCentre, Position = new Vector2(0, 45f), Alpha = 0, Font = "Exo2.0-Light", TextSize = 42f } } }, // Control panel container new Container { RelativeSizeAxes = Axes.Both, Width = 0.15f, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(54, 54, 54, 255) }, new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = "Control Panel", TextSize = 22f, Font = "Exo2.0-Bold" }, new FillFlowContainer { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Width = 0.75f, Position = new Vector2(0, 35f), Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5f), Children = new Drawable[] { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Begin random", Action = teamsContainer.StartScrolling, }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Stop random", Action = teamsContainer.StopScrolling, }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Reload", Action = reloadTeams } } }, new FillFlowContainer { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Width = 0.75f, Position = new Vector2(0, -5f), Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5f), Children = new Drawable[] { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Reset", Action = () => reset(false) } } } } } } } }; teamsContainer.OnSelected += onTeamSelected; teamsContainer.OnScrollStarted += () => fullTeamNameText.FadeOut(200); reset(true); }
private void load(TextureStore textures) { Texture = textures.Get("Gameplay/osu/blinds-panel"); }
private void load(TextureStore textures) { RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(106, 100, 104, 255) }, new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Relative, .1f), new Dimension(), }, ColumnDimensions = new[] { new Dimension(), }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(60, 60, 60, 255) }, new Container { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, Width = .2f, Child = new SimpleIconButton(FontAwesome.Solid.Home) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = this.Exit, } }, } } }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Child = new BasicScrollContainer { RelativeSizeAxes = Axes.Both, ClampExtension = 30, Child = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, Height = 400, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Red }, new GamePreviewContainer(onlineGame) { GameNameSize = 90, MadeBySize = 60, } } }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Child = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Text = @"Descripción:", Font = new FontUsage(size: 70) }, new TextFlowContainer((e) => e.Font = new FontUsage(size: 70)) { RelativeSizeAxes = Axes.X, Height = 300, Text = onlineGame.Description, }, }, }, }, new SpriteText { Text = "Salas:", Font = new FontUsage(size: 80) }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding(80), Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(.9f), Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.LightGray }, errorText = new TextFlowContainer((e) => { e.Font = new FontUsage(size: 80); e.Colour = Colour4.Black; }) { RelativeSizeAxes = Axes.X, Height = 1000, }, }, }, new BasicScrollContainer { RelativeSizeAxes = Axes.X, Height = 1000, ClampExtension = 30, Masking = true, BorderColour = Colour4.Black, BorderThickness = 3.5f, Child = gameRooms = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical }, }, }, }, new Container { RelativeSizeAxes = Axes.X, Height = 200, Child = reportButton = new GamesToGoButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Height = 150, Width = .85f, Text = @"Reportar", Action = () => reportOverlay.Show() }, }, }, }, }, }, }, }, }, new Container { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Size = new Vector2(300), Padding = new MarginPadding(50), Child = new CircularContainer { RelativeSizeAxes = Axes.Both, Masking = true, Child = new SurfaceButton { Action = createRoom, BackgroundColour = Colour4.Pink, Children = new Drawable[] { new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Height = .4f, Width = .4f, Icon = FontAwesome.Solid.Plus, }, }, }, }, }, reportOverlay = new ReportOverlay() { Game = onlineGame } }; reportButton.SpriteText.Font = new FontUsage(size: 80); populateRooms(); }
private void load(TextureStore textures) { Texture = textures.Get("background-day"); RelativeSizeAxes = Axes.Y; Height = 1.0f; }
private void load(TextureStore textures) { layer.Texture = textures.Get(@"Play/osu/ring-glow@2x"); }
private void load(OverlayColourProvider colourProvider, TextureStore textures) { Container <Drawable> hiddenDetailContainer; Container <Drawable> expandedDetailContainer; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background4 }, new FillFlowContainer { AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Vertical = 10 }, Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Spacing = new Vector2(10, 0), Children = new Drawable[] { new AddFriendButton { RelativeSizeAxes = Axes.Y, User = { BindTarget = User } }, new MessageUserButton { User = { BindTarget = User } }, // Disabled temporarily, Will be available // after peppy improves the watch stream system // (Supports watch to stable players gameplay.) /*new SpectatePlayerButton * { * RelativeSizeAxes = Axes.Y, * User = { BindTarget = User } * },*/ } }, new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, Padding = new MarginPadding { Vertical = 10 }, Width = UserProfileOverlay.CONTENT_X_MARGIN, Child = new ExpandDetailsButton { RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, Origin = Anchor.Centre, DetailsVisible = { BindTarget = DetailsVisible } }, }, new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Right = UserProfileOverlay.CONTENT_X_MARGIN }, Children = new Drawable[] { new LevelBadge { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Size = new Vector2(40), User = { BindTarget = User } }, expandedDetailContainer = new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Width = 200, Height = 6, Margin = new MarginPadding { Right = 50 }, Child = new LevelProgressBar { RelativeSizeAxes = Axes.Both, User = { BindTarget = User } } }, hiddenDetailContainer = new FillFlowContainer { Direction = FillDirection.Horizontal, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Width = 200, AutoSizeAxes = Axes.Y, Alpha = 0, Spacing = new Vector2(10, 0), Margin = new MarginPadding { Right = 50 }, Children = new[] { hiddenDetailGlobal = new OverlinedInfoContainer { Title = "全球排名", LineColour = colourProvider.Highlight1 }, hiddenDetailCountry = new OverlinedInfoContainer { Title = "國家排名", LineColour = colourProvider.Highlight1 }, } } } } }; DetailsVisible.BindValueChanged(visible => { hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint); expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint); }); User.BindValueChanged(user => updateDisplay(user.NewValue)); }
private void load(TextureStore textures) { disc.Texture = textures.Get(@"Play/osu/disc@2x"); }
private void load(TextureStore textures) { Child = new SkinnableDrawable("Play/osu/approachcircle", name => new Sprite { Texture = textures.Get(name) }); }
private void load(TextureStore store) { texture = store.Get(@"sample-texture"); }
private void load(TextureStore textures) { Texture = textures.Get(@"Headers/news"); }
private void load(OsuColour colours, APIAccess api, OsuGame game, TextureStore textures) { this.api = api; if (string.IsNullOrEmpty(api.ProvidedUsername)) { return; } Children = new Drawable[] { new Sprite { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Texture = textures.Get(@"Menu/dev-build-footer"), }, new Sprite { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Texture = textures.Get(@"Menu/dev-build-footer"), }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding(20), Spacing = new Vector2(0, 5), Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, Height = 150, Child = new OsuLogo { Scale = new Vector2(0.1f), Anchor = Anchor.Centre, Triangles = false, }, }, new OsuSpriteText { TextSize = 28, Font = "Exo2.0-Light", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = Color4.Red, Text = "Warning! 注意!", }, multiAccountExplanationText = new OsuTextFlowContainer(cp => { cp.TextSize = 12; }) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y }, new SettingsButton { Text = "Help, I can't access my account!", Margin = new MarginPadding { Top = 50 }, Action = () => game?.OpenUrlExternally(help_centre_url) }, new DangerousSettingsButton { Text = "I understand. This account isn't for me.", Action = () => Push(new ScreenEntry()) }, furtherAssistance = new LinkFlowContainer(cp => { cp.TextSize = 12; }) { Margin = new MarginPadding { Top = 20 }, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, AutoSizeAxes = Axes.Both }, } } }; multiAccountExplanationText.AddText("Are you "); multiAccountExplanationText.AddText(api.ProvidedUsername, cp => cp.Colour = colours.BlueLight); multiAccountExplanationText.AddText("? osu! has a policy of "); multiAccountExplanationText.AddText("one account per person!", cp => cp.Colour = colours.Yellow); multiAccountExplanationText.AddText(" Please be aware that creating more than one account per person may result in "); multiAccountExplanationText.AddText("permanent deactivation of accounts", cp => cp.Colour = colours.Yellow); multiAccountExplanationText.AddText("."); furtherAssistance.AddText("Need further assistance? Contact us via our "); furtherAssistance.AddLink("support system", help_centre_url); furtherAssistance.AddText("."); }
private void load(TextureStore textures) { AddFrame(textures.Get("https://a.ppy.sh/2"), 500); AddFrame(textures.Get("https://a.ppy.sh/3"), 500); AddFrame(textures.Get("https://a.ppy.sh/1876669"), 500); }
private void load(TextureStore textures) { RelativeSizeAxes = Axes.Both; Masking = true; BorderColour = Colour4.Black; BorderThickness = 3.5f; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.LightGray, }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Padding = new MarginPadding(20), Spacing = new Vector2(20), Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Width = .2f, Child = gameImage = new Sprite { RelativeSizeAxes = Axes.Both, Texture = textures.Get("Images/gtg"), }, }, new Container { RelativeSizeAxes = Axes.Both, Width = .5f, Child = new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Height = .5f, Child = new TextFlowContainer((w) => w.Font = new FontUsage(size: 60)) { RelativeSizeAxes = Axes.Both, Text = @"Sala de " + room.Owner.Username, }, }, new Container { RelativeSizeAxes = Axes.Both, Height = .5f, Child = new SpriteText { Text = "Id: " + room.Id, Font = new FontUsage(size: 50), }, }, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Width = .3f, Padding = new MarginPadding() { Right = 50 }, Child = new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Width = .4f, Child = new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = room.CurrentPlayers + "/" + room.Game.Maxplayers, Font = new FontUsage(size: 60) } }, new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Width = .6f, Padding = new MarginPadding(10), Child = new SpriteIcon { RelativeSizeAxes = Axes.Both, Icon = FontAwesome.Solid.Users }, }, }, }, }, }, }, }; Schedule(async() => { gameImage.Texture = await textures.GetAsync($"https://gamestogo.company/api/Users/DownloadImage/{room.Owner.ID}"); }); }
public FallbackTextureStore(TextureStore primary, TextureStore fallback) { this.primary = primary; this.fallback = fallback; }
private void load(FrameworkConfigManager config) { Resources = new ResourceStore <byte[]>(); Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(typeof(Game).Assembly), @"Resources")); Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures"))); Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore())); dependencies.Cache(Textures); var tracks = new ResourceStore <byte[]>(); tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks")); tracks.AddStore(new OnlineStore()); var samples = new ResourceStore <byte[]>(); samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples")); samples.AddStore(new OnlineStore()); Audio = new AudioManager(Host.AudioThread, tracks, samples) { EventScheduler = Scheduler }; dependencies.Cache(Audio); dependencies.CacheAs(Audio.Tracks); dependencies.CacheAs(Audio.Samples); // attach our bindables to the audio subsystem. config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice); config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume); config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample); config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack); Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders")); dependencies.Cache(Shaders); var cacheStorage = Host.Storage.GetStorageForDirectory(Path.Combine("cache", "fonts")); // base store is for user fonts Fonts = new FontStore(useAtlas: true, cacheStorage: cacheStorage); // nested store for framework provided fonts. // note that currently this means there could be two async font load operations. Fonts.AddStore(localFonts = new FontStore(useAtlas: false)); addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans"); addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-Bold"); addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-Italic"); addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-BoldItalic"); addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Solid"); addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Regular"); addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Brands"); dependencies.Cache(Fonts); Localisation = new LocalisationManager(config); dependencies.Cache(Localisation); frameSyncMode = config.GetBindable <FrameSync>(FrameworkSetting.FrameSync); executionMode = config.GetBindable <ExecutionMode>(FrameworkSetting.ExecutionMode); logOverlayVisibility = config.GetBindable <bool>(FrameworkSetting.ShowLogOverlay); logOverlayVisibility.BindValueChanged(visibility => { if (visibility.NewValue) { if (logOverlay == null) { LoadComponentAsync(logOverlay = new LogOverlay { Depth = float.MinValue / 2, }, AddInternal); } logOverlay.Show(); } else { logOverlay?.Hide(); } }, true); }
private void load(TextureStore textures) { logo.Texture = textures.Get(@"Menu/logo"); ripple.Texture = textures.Get(@"Menu/logo"); }
private void load(TextureStore ts) { textureStore = ts; UpdateObjectID(LevelObject.ObjectID); }
private void load(TextureStore textures) { Texture = textures.Get($@"https://a.ppy.sh/{userId}"); }
private void load(TextureStore textures) { layer.Texture = textures.Get(@"Play/osu/ring-glow"); }
private void load(BeatmapCollection collection, TextureStore store) { collection.CurrentBeatmap.ValueChanged += OnBeatmapChanged; AddRangeInternal(new Drawable[] { new SpaceParticlesContainer(), new LinearVisualizer { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, ValueMultiplier = 3500, BarsAmount = 200, Alpha = 0.25f, BarWidth = 5, Spacing = 5, }, new LinearVisualizer { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, ValueMultiplier = 3500, IsReversed = true, BarsAmount = 200, Alpha = 0.25f, BarWidth = 5, Spacing = 5, }, new LinearVisualizer { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, ValueMultiplier = 3500, IsReversed = true, BarsAmount = 200, Alpha = 0.25f, BarWidth = 5, Spacing = 5, }, new LinearVisualizer { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, ValueMultiplier = 3500, BarsAmount = 200, Alpha = 0.25f, BarWidth = 5, Spacing = 5, }, new CircularVisualizer { Anchor = Anchor.Centre, Origin = Anchor.Centre, ValueMultiplier = 800, DegreeValue = 180, BarsAmount = 100, CircleSize = 348, BarWidth = 2, Alpha = 0.5f, }, new CircularVisualizer { Anchor = Anchor.Centre, Origin = Anchor.Centre, ValueMultiplier = 800, DegreeValue = 180, BarsAmount = 100, CircleSize = 348, BarWidth = 2, Rotation = 180, Alpha = 0.5f, }, new CircularVisualizer { Anchor = Anchor.Centre, Origin = Anchor.Centre, ValueMultiplier = 800, IsReversed = true, DegreeValue = 180, BarsAmount = 100, CircleSize = 348, BarWidth = 2, Alpha = 0.5f, }, new CircularVisualizer { Anchor = Anchor.Centre, Origin = Anchor.Centre, ValueMultiplier = 800, IsReversed = true, DegreeValue = 180, BarsAmount = 100, CircleSize = 348, BarWidth = 2, Rotation = 180, Alpha = 0.5f, }, new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(350), Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.18f), Offset = new Vector2(0, 2), Radius = 6, }, Child = beatmapSprite = new OutlinedSprite { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, BlurSigma = 10 } }, }); beatmapSprite.Texture = collection.CurrentBeatmap.Value.Logo ?? collection.CurrentBeatmap.Value.Background ?? store.Get("Backgrounds/bg2.jpg"); }
protected Skin(SkinInfo skin, IStorageResourceProvider?resources, IResourceStore <byte[]>?storage = null, string configurationFilename = @"skin.ini") { if (resources != null) { SkinInfo = skin.ToLive(resources.RealmAccess); storage ??= new RealmBackedResourceStore(skin, resources.Files, new[] { @"ogg" }); var samples = resources.AudioManager?.GetSampleStore(storage); if (samples != null) { samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY; } Samples = samples; Textures = new TextureStore(resources.CreateTextureLoaderStore(storage)); } else { // Generally only used for tests. SkinInfo = skin.ToLiveUnmanaged(); } var configurationStream = storage?.GetStream(configurationFilename); if (configurationStream != null) { // stream will be closed after use by LineBufferedReader. ParseConfigurationStream(configurationStream); Debug.Assert(Configuration != null); } else { Configuration = new SkinConfiguration(); } // skininfo files may be null for default skin. foreach (SkinnableTarget skinnableTarget in Enum.GetValues(typeof(SkinnableTarget))) { string filename = $"{skinnableTarget}.json"; byte[]? bytes = storage?.Get(filename); if (bytes == null) { continue; } try { string jsonContent = Encoding.UTF8.GetString(bytes); var deserializedContent = JsonConvert.DeserializeObject <IEnumerable <SkinnableInfo> >(jsonContent); if (deserializedContent == null) { continue; } DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray(); } catch (Exception ex) { Logger.Error(ex, "Failed to load skin configuration."); } } }
private void load(TextureStore textures) { flagSprite.Texture = textures.Get($@"Flags/{Team.FlagName}"); }
private void load(ShaderManager shaders, TextureStore textures) { shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.Texture); texture = textures.Get(@"Cursor/cursortrail"); }
private void load(TextureStore textures) { if (!string.IsNullOrEmpty(textureName)) Sprite.Texture = textures.Get(textureName); }
private void load(TextureStore textures) { logo.Texture = textures.Get(@"Menu/logo@2x"); ripple.Texture = textures.Get(@"Menu/logo@2x"); }
private void load(TextureStore textures) { badge.Texture = textures.Get($"Grades/{grade}"); }
private void load(OsuGameBase osuGame, BeatmapDatabase beatmaps, AudioManager audio, TextureStore textures, OsuColour colours) { Children = new Drawable[] { title = new SpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 40), TextSize = 25, Colour = Color4.White, Text = @"Nothing to play", Font = @"Exo2.0-MediumItalic" }, artist = new SpriteText { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 45), TextSize = 15, Colour = Color4.White, Text = @"Nothing to play", Font = @"Exo2.0-BoldItalic" }, new ClickableContainer { AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.BottomCentre, Position = new Vector2(0, -30), Action = () => { if (current?.Track == null) return; if (current.Track.IsRunning) current.Track.Stop(); else current.Track.Start(); }, Children = new Drawable[] { playButton = new TextAwesome { TextSize = 30, Icon = FontAwesome.fa_play_circle_o, Origin = Anchor.Centre, Anchor = Anchor.Centre } } }, new ClickableContainer { AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.BottomCentre, Position = new Vector2(-30, -30), Action = prev, Children = new Drawable[] { new TextAwesome { TextSize = 15, Icon = FontAwesome.fa_step_backward, Origin = Anchor.Centre, Anchor = Anchor.Centre } } }, new ClickableContainer { AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.BottomCentre, Position = new Vector2(30, -30), Action = next, Children = new Drawable[] { new TextAwesome { TextSize = 15, Icon = FontAwesome.fa_step_forward, Origin = Anchor.Centre, Anchor = Anchor.Centre } } }, new ClickableContainer { AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.BottomRight, Position = new Vector2(20, -30), Children = new Drawable[] { listButton = new TextAwesome { TextSize = 15, Icon = FontAwesome.fa_bars, Origin = Anchor.Centre, Anchor = Anchor.Centre } } }, progress = new DragBar { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Height = 10, Colour = colours.Yellow, SeekRequested = seek } }; this.beatmaps = beatmaps; trackManager = osuGame.Audio.Track; config = osuGame.Config; preferUnicode = osuGame.Config.GetBindable<bool>(OsuConfig.ShowUnicode); preferUnicode.ValueChanged += preferUnicode_changed; beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>(); playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>(); backgroundSprite = new MusicControllerBackground(); AddInternal(backgroundSprite); }
private void load(TextureStore textures) { Texture = textures.Get("Textures/emu_went_brrr"); }
private void load(TextureStore textures) { levelBadge.Texture = textures.Get(@"Profile/levelbadge"); }
private void load(OsuGame game, TextureStore textures) { this.game = game; guestTexture = textures.Get(@"Online/avatar-guest@2x"); }