Exemplo n.º 1
0
        private void addTexture(TextureGLAtlas texture) => Schedule(() =>
        {
            if (panelFlow.Any(p => p.AtlasTexture == texture))
            {
                return;
            }

            panelFlow.Add(new TexturePanel(texture));
        });
Exemplo n.º 2
0
        protected override void PopIn()
        {
            base.PopIn();

            foreach (var tex in TextureGLAtlas.GetAllAtlases())
            {
                addTexture(tex);
            }

            TextureGLAtlas.TextureCreated += addTexture;
        }
Exemplo n.º 3
0
            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),
                        },
                    }
                };
            }