This commit is contained in:
h z
2024-06-26 14:23:02 +08:00
parent cbe5887f5f
commit b8af5f3ccd
22 changed files with 467 additions and 174 deletions

View File

@@ -8,7 +8,7 @@ public partial class FlaskContent : ColorRect
public HomogeneousMixture Mixture { get; set; } = HomogeneousMixture.Null;
private const double ContainerHeight = 512d;
public double ContainerVolume => Mixture.HeterogeneousMixture.Container.Volume();
private double ContainerVolume => Mixture.HeterogeneousMixture.Container.Volume();
public double Volume => Mixture.Volume;
private TextureButton Mask { get; set; }
@@ -31,22 +31,21 @@ public partial class FlaskContent : ColorRect
double height = (Volume / ContainerVolume) * ContainerHeight;
Position = new Vector2(Position.X, 512-(float)(StartFrom + height));
Size = new Vector2(Size.X, (float)height);
//Mask.Size = Size;
Color = Color.Color8(
Mixture.ColorRed,
Mixture.ColorGreen,
Mixture.ColorGreen,
Mixture.ColorTransparent
);
/*
Animation a = AP.GetAnimation("HeightChange");
/*Animation a = AP.GetAnimation("HeightChange");
a.TrackSetKeyValue(0, 0, Size);
a.TrackSetKeyValue(0, 1, new Vector2(Size.X, (float)height));
AP.Play("HeightChange");
AP.Play("PositionChange");
a = AP.GetAnimation("PositionChange");
a.TrackSetKeyValue(0,0,Position);
a.TrackSetKeyValue(0,1, new Vector2(Position.X, -(float)StartFrom));
a.TrackSetKeyValue(0,1, new Vector2(Position.X, 512-(float)(StartFrom + height)));
Color = Color.Color8(Mixture.ColorRed, Mixture.ColorGreen, Mixture.ColorGreen, Mixture.ColorTransparent);
AP.Play();*/
}