I think this is a good learning example.
I'm trying to fill up this cup with water as the user moves a slider up/down.
One way I thought about achieving this was by having 2 pictures. One of a full cup, one of an empty cup and having the full cup's being positioned on top of the empty cup and having the height 0 when empty and at 100% height when full.
How would you go about controlling the image object height programatically?