From 04ab7fe8c1b79f0c521114fc2a92015908ecb86b Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Thu, 31 Jan 2002 17:34:20 +0000 Subject: [PATCH] Added support for expiring an explode animation after a set time delay. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@907 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/media/animation/ExplodeAnimation.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/media/animation/ExplodeAnimation.java b/src/java/com/threerings/media/animation/ExplodeAnimation.java index c78f16970..8b531398e 100644 --- a/src/java/com/threerings/media/animation/ExplodeAnimation.java +++ b/src/java/com/threerings/media/animation/ExplodeAnimation.java @@ -1,5 +1,5 @@ // -// $Id: ExplodeAnimation.java,v 1.5 2002/01/19 06:06:05 shaper Exp $ +// $Id: ExplodeAnimation.java,v 1.6 2002/01/31 17:34:20 shaper Exp $ package com.threerings.media.animation; @@ -37,6 +37,10 @@ public class ExplodeAnimation extends Animation /** The chunk rotational velocity in rotations per millisecond. */ public float rvel; + + /** The animation length in milliseconds, or -1 if the animation + * should continue until all pieces are outside the bounds. */ + public long delay; } /** @@ -165,7 +169,8 @@ public class ExplodeAnimation extends Animation // increment the rotation angle _angle += _info.rvel; - _finished = (inside == 0); + _finished = (inside == 0) || + (_info.delay > -1 && timestamp >= (_start + _info.delay)); invalidate(); }