On FadableImageSprite, we need to check for end-of-path fade in/fade out PRIOR to calling super, which chats with our sprite observers. Otherwise, those sprite observers might dispatch the sprite on a new fade which would then be immediately applied at full strength rather than applying slowly over the appropriate interval.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@776 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -55,7 +55,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts this sprite on the specified path and fades it in over the specified duration.
|
* Puts this sprite on the specified path and fades it in over the specified duration.
|
||||||
*
|
*
|
||||||
* @param path the path to move along
|
* @param path the path to move along
|
||||||
* @param fadePortion the portion of time to spend fading in, from 0.0f (no time) to 1.0f (the
|
* @param fadePortion the portion of time to spend fading in, from 0.0f (no time) to 1.0f (the
|
||||||
* entire time)
|
* entire time)
|
||||||
@@ -71,7 +71,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts this sprite on the specified path and fades it out over the specified duration.
|
* Puts this sprite on the specified path and fades it out over the specified duration.
|
||||||
*
|
*
|
||||||
* @param path the path to move along
|
* @param path the path to move along
|
||||||
* @param pathDuration the duration of the path
|
* @param pathDuration the duration of the path
|
||||||
* @param fadePortion the portion of time to spend fading out, from 0.0f (no time) to 1.0f
|
* @param fadePortion the portion of time to spend fading out, from 0.0f (no time) to 1.0f
|
||||||
@@ -92,7 +92,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
/**
|
/**
|
||||||
* Puts this sprite on the specified path, fading it in over the specified duration at the
|
* Puts this sprite on the specified path, fading it in over the specified duration at the
|
||||||
* beginning and fading it out at the end.
|
* beginning and fading it out at the end.
|
||||||
*
|
*
|
||||||
* @param path the path to move along
|
* @param path the path to move along
|
||||||
* @param pathDuration the duration of the path
|
* @param pathDuration the duration of the path
|
||||||
* @param fadePortion the portion of time to spend fading in/out, from 0.0f (no time) to 1.0f
|
* @param fadePortion the portion of time to spend fading in/out, from 0.0f (no time) to 1.0f
|
||||||
@@ -161,12 +161,12 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
@Override
|
@Override
|
||||||
public void pathCompleted (long timestamp)
|
public void pathCompleted (long timestamp)
|
||||||
{
|
{
|
||||||
super.pathCompleted(timestamp);
|
|
||||||
if (_fadeInDuration != -1) {
|
if (_fadeInDuration != -1) {
|
||||||
completeFadeIn();
|
completeFadeIn();
|
||||||
} else if (_fadeOutDuration != -1) {
|
} else if (_fadeOutDuration != -1) {
|
||||||
completeFadeOut();
|
completeFadeOut();
|
||||||
}
|
}
|
||||||
|
super.pathCompleted(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Completes the process of fading in. */
|
/** Completes the process of fading in. */
|
||||||
|
|||||||
Reference in New Issue
Block a user