This commit is contained in:
h z
2024-06-24 07:27:50 +08:00
parent d0d90501a5
commit 634c503c7c
8 changed files with 67 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
using System;
using Godot;
using Skeleton.DataStructure.Link;
using VirtualChemistry.Chemistry.Mixtures.Implements;
@@ -28,6 +29,16 @@ public partial class FlaskContent : ColorRect
public void UpdateVolumeAndPosition()
{
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");
a.TrackSetKeyValue(0, 0, Size);
a.TrackSetKeyValue(0, 1, new Vector2(Size.X, (float)height));
@@ -36,7 +47,8 @@ public partial class FlaskContent : ColorRect
a = AP.GetAnimation("PositionChange");
a.TrackSetKeyValue(0,0,Position);
a.TrackSetKeyValue(0,1, new Vector2(Position.X, -(float)StartFrom));
AP.Play();
Color = Color.Color8(Mixture.ColorRed, Mixture.ColorGreen, Mixture.ColorGreen, Mixture.ColorTransparent);
AP.Play();*/
}
// Called when the node enters the scene tree for the first time.