Exemplo n.º 1
0
 private void load(CubismAssetStore cubismAssets)
 {
     Add(Container = new Container <Drawable>
     {
         Size     = new Vector2(684),
         Anchor   = Anchor.Centre,
         Origin   = Anchor.Centre,
         Children = new Drawable[]
         {
             new Box
             {
                 RelativeSizeAxes = Axes.Both,
                 Colour           = BackgroundColour
             },
             Sprite = new CubismSprite
             {
                 RelativeSizeAxes = Axes.Both,
                 Asset            = cubismAssets.Get("Hiyori.Hiyori.model3.json"),
                 Renderer         = new CubismRenderer
                 {
                     Scale = new Vector2(2),
                     Y     = 384
                 }
             }
         }
     });
 }
Exemplo n.º 2
0
        private void updateModel()
        {
            Clear(true);

            Child = Sprite = new CubismSprite
            {
                Asset            = assets.Get(asset.Value),
                RelativeSizeAxes = Axes.Both,
            };

            updateRenderer();
        }
        public TestSceneCubismSprite()
        {
            var moc      = new CubismMoc(TestResources.GetModelResource("Hiyori.moc3"));
            var textures = new[]
            {
                Texture.FromStream(TestResources.GetModelResource("textures/texture_00.png")),
                Texture.FromStream(TestResources.GetModelResource("textures/texture_01.png")),
            };

            Model         = new CubismModel(moc);
            Sprite        = CreateSprite(Model, textures);
            Sprite.Size   = new Vector2(SpriteSize);
            Sprite.Anchor = Anchor.Centre;
            Sprite.Origin = Anchor.Centre;
            Add(Sprite);
        }
Exemplo n.º 4
0
            public ParameterMonitor(CubismSprite sprite, string[] parameters)
            {
                Width            = 350;
                RelativeSizeAxes = Axes.Y;
                Direction        = FillDirection.Full;

                this.sprite = sprite;
                foreach (var param in parameters)
                {
                    if (sprite.Asset.Model.GetParameter(param) == null)
                    {
                        continue;
                    }

                    var bar = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Colour           = Colour4.White,
                        Height           = 5
                    };

                    bars.Add(param, bar);

                    Add(new FillFlowContainer
                    {
                        Direction = FillDirection.Vertical,
                        Width     = 150,
                        Height    = 30,
                        Margin    = new MarginPadding(5),
                        Children  = new Drawable[]
                        {
                            new SpriteText {
                                Text = param, Scale = new Vector2(0.75f)
                            },
                            bar
                        }
                    });
                }
            }
        private void updateModel()
        {
            Clear(true);

            CubismAsset loaded;

            try
            {
                loaded = assets.Get(asset.Value);
            }
            catch
            {
                loaded = userAssets.Get(asset.Value);
            }

            Child = Sprite = new CubismSprite
            {
                Asset            = loaded,
                RelativeSizeAxes = Axes.Both,
            };

            updateRenderer();
        }