My team and I are making a bar game where you pour alcoholic drinks at a bar. Further details are not relevant aside from the fact that this is a 2D game.
We have done most of the graphics but are stuck on finding an elegant way to fill a glass with liquid - or even just a colour. The glasses are sprites so as far as I know I can’t use a UI image with vertical fill (since UI elements always show up in front of everything else). One solution may be to make the glasses UI images so I can do it this way, but it seems unintuitive. I want to keep the glasses as sprites and not UI images.
So how could we get the UI Image vertical fill functionality to work with a sprite? Is there a way? Do you guys have any other ideas on how this could be done?
I did try that, but it scales it from the centre outwards. Is there a way (using anchor or something) to make it scale upwards? I did this with some UI images but they are rect transform and have all of those built in anchors (which I used bottom centre).
edit: *make it scale from the bottom up, rather than centre out (in both directions) which is what happens at the moment.
Sorry, sprite editor? Do you mean the inspector? I am using a prefab for the liquid also. I only see Transform and Sprite Renderer. Transform is not a rect transform and does not have anchor or pivot (that I can see). I am working on the scaling idea and simply moving the sprite as I scale it, this should work. Unless you have any other ideas? Or can you explain your previous post in further detail?
Yes, check your import settings for the texture, there you can change your pivot, or enter the sprite editor (see the button?) and you can visually place it where you want it to be.