private void addTexture(TextureGLAtlas texture) => Schedule(() => { if (panelFlow.Any(p => p.AtlasTexture == texture)) { return; } panelFlow.Add(new TexturePanel(texture)); });
protected override void PopIn() { base.PopIn(); foreach (var tex in TextureGLAtlas.GetAllAtlases()) { addTexture(tex); } TextureGLAtlas.TextureCreated += addTexture; }
public TexturePanel(TextureGLAtlas atlasTexture) { atlasReference = new WeakReference <TextureGLAtlas>(atlasTexture); Size = new Vector2(100, 132); InternalChild = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { titleText = new SpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Font = FontUsage.Default.With(size: 16) }, new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { usage = new UsageBackground(atlasReference) { Size = new Vector2(100) }, }, }, footerText = new SpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Font = FontUsage.Default.With(size: 16), }, } }; }