Create an hour glass

Is there an extension out there for purchase or is there an elegant way to code an hour glass?

Essentially I would like the hourglass to deplete from the top-end in 20 seconds (or 10 seconds) depending on the time I define in another variable.

I was going to do a 20 frame animation but I think maybe there is a way to use height and make the hourglass be a liquid rather than pebble of sand. Issue is that my background is not a single color - so I can’t really mask part of a rectangle (water/liquid) by another object that looks like it is the background.

Thoughts?

Sometimes best way to do it is just to do it
Glass
And imagine drawing that hourglass took most of the time

If this is for you chess game i would suggest normal digital timer
Or analog or both

But if you want hourglass so bad

I am using real time for analog
And time from start looped to 60 sec
But in both cases i would assume you would use timer and/or variable

1 Like

Hi ZeroX4,

I was trying this a different way but looks like my logic is flawed. I have not randomized the angle yet of the drops.

Screen recording 2025-02-09 11.27.58 PM

You could make the hourglass and sand grains out of a number of sprites with Physics2 behaviour.

You could also make use of the Marching Squares demo, though it’d make the hourglass internals look like a liquid.

1 Like

Randomization in my case is there only as visual effect
It serves NO other purpose

@MrMen i suck with physics since i was never using them
BUT i did try them
And well i bet i did something wrong but
If sand is box there is like gap between grins like of a size of whole grin or bigger
If sand is circle it was working cool but VERY fast it started to lag my whole game
If you could provide some example i would be thankful
Cause that would help not only fox but also me
Since i would start to understand how to use physics

1 Like

That’s pretty much how I’d do it. A few years ago I had a physics based game that had 100-150 dynamic circles, and there was a distinct slow down of the game. So it may be something unavoidable for now.

1 Like